More reviews

The bat faction needs to use \ref, since the faction check system uses that too.
This commit is contained in:
SabreML
2021-09-02 21:05:18 +01:00
parent 0a4b398b06
commit e9f807fa3b
5 changed files with 39 additions and 31 deletions
+7 -2
View File
@@ -16,6 +16,7 @@
if(!new_info)
return INITIALIZE_HINT_QDEL
mob_info = new_info
RegisterSignal(mob_info, COMSIG_PARENT_QDELETING, .proc/delete_wrapper)
update_self()
forceMove(mob_info.spawn_point)
if(!mob_info.is_trap)
@@ -24,11 +25,15 @@
/obj/effect/nanomob/Destroy()
SSmob_hunt.trap_spawns -= src
SSmob_hunt.normal_spawns -= src
mob_info = null // Can't delete this since multiple players can get the exact same /datum/mob_hunt. (This should be refactored)
clients_encountered.Cut()
QDEL_NULL(mob_info)
qdel(avatar)
QDEL_NULL(avatar)
return ..()
/obj/effect/nanomob/proc/delete_wrapper()
SIGNAL_HANDLER
qdel(src)
/obj/effect/nanomob/proc/update_self()
if(!mob_info)
return
@@ -33,27 +33,16 @@
// break_stuff_probability = 2
faction = list("scarybat")
var/mob/living/owner
gold_core_spawnable = HOSTILE_SPAWN
/mob/living/simple_animal/hostile/scarybat/New(loc, mob/living/L as mob)
..()
/mob/living/simple_animal/hostile/scarybat/Initialize(mapload, mob/living/L)
. = ..()
if(istype(L))
owner = L
faction += "\ref[L]"
/mob/living/simple_animal/hostile/scarybat/Process_Spacemove(check_drift = 0)
return ..() //No drifting in space for space carp! //original comments do not steal
/mob/living/simple_animal/hostile/scarybat/Found(atom/A)//This is here as a potential override to pick a specific target if available
if(istype(A) && A == owner)
return 0
return ..()
/mob/living/simple_animal/hostile/scarybat/CanAttack(atom/the_target)//This is here as a potential override to pick a specific target if available
if(istype(the_target) && the_target == owner)
return 0
return ..()
/mob/living/simple_animal/hostile/scarybat/AttackingTarget()
. =..()
var/mob/living/L = .
+25 -9
View File
@@ -79,13 +79,14 @@
return
scan_nearby()
/datum/data/pda/app/mob_hunter_game/proc/register_capture(datum/mob_hunt/captured, wild = 0)
/datum/data/pda/app/mob_hunter_game/proc/register_capture(datum/mob_hunt/captured, wild = FALSE)
if(!captured)
return 0
my_collection.Add(captured)
return FALSE
my_collection += captured
RegisterSignal(captured, COMSIG_PARENT_QDELETING, .proc/remove_mob)
if(wild)
wild_captures++
return 1
return TRUE
/datum/data/pda/app/mob_hunter_game/update_ui(mob/user, list/data)
if(!SSmob_hunt || !(src in SSmob_hunt.connected_clients))
@@ -143,12 +144,27 @@
card.forceMove(get_turf(pda))
remove_mob()
/datum/data/pda/app/mob_hunter_game/proc/remove_mob()
if(!my_collection.len)
/**
* Removes a Nanomob from the [my_collection] list.
*
* The Nanomob that is currently selected in the app ([current_index]) will be removed from the list unless a `mob_override` argument is given, in which case that will be removed instead.
*
* Arguments:
* * mob_override - A specific Nanomob to remove from the list. (Optional)
*/
/datum/data/pda/app/mob_hunter_game/proc/remove_mob(datum/mob_hunt/mob_override = null)
SIGNAL_HANDLER
var/collection_length = length(my_collection)
if(!collection_length)
return
my_collection.Remove(my_collection[current_index])
if(current_index > my_collection.len)
current_index = my_collection.len
if(mob_override)
my_collection -= mob_override
else
my_collection -= my_collection[current_index]
if(current_index > collection_length)
current_index = collection_length
/datum/data/pda/app/mob_hunter_game/proc/set_trap()
if(!my_collection.len || !pda || !hacked)
+3 -6
View File
@@ -32,12 +32,9 @@
wires["Black"] = 0
wires["White"] = 0
var/list/w = list("Red","Blue","Green","Yellow","Black","White")
hack_wire = pick(w)
w -= hack_wire
shock_wire = pick(w)
w -= shock_wire
disable_wire = pick(w)
w -= disable_wire
hack_wire = pick_n_take(w)
shock_wire = pick_n_take(w)
disable_wire = pick_n_take(w)
/obj/machinery/r_n_d/Destroy()
if(loaded_item)