diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 2265c166461..db963a1f6fe 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -3,10 +3,10 @@ name = "web" desc = "it's stringy and sticky" icon = 'icons/effects/effects.dmi' - anchored = 1 - density = 0 + anchored = TRUE + density = FALSE var/health = 15 - var/master_commander = null + var/mob/living/carbon/human/master_commander = null /obj/structure/spider/Destroy() master_commander = null @@ -15,25 +15,24 @@ //similar to weeds, but only barfed out by nurses manually /obj/structure/spider/ex_act(severity) switch(severity) - if(1.0) + if(1) qdel(src) - if(2.0) + if(2) if(prob(50)) qdel(src) - if(3.0) + if(3) if(prob(5)) qdel(src) - return -/obj/structure/spider/attackby(var/obj/item/weapon/W, var/mob/user, params) +/obj/structure/spider/attackby(obj/item/weapon/W, mob/user, params) if(W.attack_verb.len) - visible_message("[user] has [pick(W.attack_verb)] \the [src] with \the [W]!") + visible_message("[user] has [pick(W.attack_verb)] [src] with [W]!") else - visible_message("[user] has attacked \the [src] with \the [W]!") + visible_message("[user] has attacked [src] with [W]!") - var/damage = W.force / 4.0 + var/damage = W.force / 4 - if(istype(W, /obj/item/weapon/weldingtool)) + if(iswelder(W)) var/obj/item/weapon/weldingtool/WT = W if(WT.remove_fuel(0, user)) @@ -43,7 +42,7 @@ health -= damage healthcheck() -/obj/structure/spider/bullet_act(var/obj/item/projectile/Proj) +/obj/structure/spider/bullet_act(obj/item/projectile/Proj) ..() health -= Proj.damage healthcheck() @@ -61,20 +60,22 @@ icon_state = "stickyweb1" /obj/structure/spider/stickyweb/New() + ..() if(prob(50)) icon_state = "stickyweb2" /obj/structure/spider/stickyweb/CanPass(atom/movable/mover, turf/target, height=0) - if(height==0) return 1 + if(height == 0) + return TRUE if(istype(mover, /mob/living/simple_animal/hostile/poison/giant_spider)) - return 1 + return TRUE else if(istype(mover, /mob/living)) if(prob(50)) - to_chat(mover, "You get stuck in \the [src] for a moment.") - return 0 + to_chat(mover, "You get stuck in [src] for a moment.") + return FALSE else if(istype(mover, /obj/item/projectile)) return prob(30) - return 1 + return TRUE /obj/structure/spider/eggcluster name = "egg cluster" @@ -82,9 +83,10 @@ icon_state = "eggs" var/amount_grown = 0 var/player_spiders = 0 - var/faction = list() + var/list/faction = list() /obj/structure/spider/eggcluster/New() + ..() pixel_x = rand(3,-3) pixel_y = rand(3,-3) processing_objects.Add(src) @@ -92,10 +94,10 @@ /obj/structure/spider/eggcluster/process() amount_grown += rand(0,2) if(amount_grown >= 100) - var/num = rand(3,12) - for(var/i=0, i[src] dies!") - new /obj/effect/decal/cleanable/spiderling_remains(src.loc) + new /obj/effect/decal/cleanable/spiderling_remains(loc) qdel(src) /obj/structure/spider/spiderling/healthcheck() @@ -143,7 +146,7 @@ /obj/structure/spider/spiderling/process() if(travelling_in_vent) - if(istype(src.loc, /turf)) + if(istype(loc, /turf)) travelling_in_vent = 0 entry_vent = null else if(entry_vent) @@ -190,7 +193,7 @@ var/target_atom = pick(nearby) walk_to(src, target_atom) if(prob(40)) - src.visible_message("\The [src] skitters[pick(" away"," around","")].") + visible_message("[src] skitters[pick(" away"," around","")].") else if(prob(10)) //ventcrawl! for(var/obj/machinery/atmospherics/unary/vent_pump/v in view(7,src)) @@ -203,8 +206,8 @@ if(amount_grown >= 100) if(!grow_as) grow_as = pick(typesof(/mob/living/simple_animal/hostile/poison/giant_spider)) - var/mob/living/simple_animal/hostile/poison/giant_spider/S = new grow_as(src.loc) - S.faction = faction + var/mob/living/simple_animal/hostile/poison/giant_spider/S = new grow_as(loc) + S.faction = faction.Copy() S.master_commander = master_commander if(player_spiders && !selecting_player) selecting_player = 1 @@ -213,9 +216,10 @@ if(candidates.len) var/mob/C = pick(candidates) - S.key = C.key - if(master_commander) - to_chat(S, "You are a spider who is loyal to [master_commander], obey [master_commander]'s every order and assist them in completing their goals at any cost.") + if(C) + S.key = C.key + if(S.master_commander) + to_chat(S, "You are a spider who is loyal to [S.master_commander], obey [S.master_commander]'s every order and assist them in completing their goals at any cost.") qdel(src) /obj/effect/decal/cleanable/spiderling_remains @@ -232,7 +236,8 @@ health = 60 /obj/structure/spider/cocoon/New() - icon_state = pick("cocoon1","cocoon2","cocoon3") + ..() + icon_state = pick("cocoon1","cocoon2","cocoon3") /obj/structure/spider/cocoon/Destroy() visible_message("[src] splits open.") diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index e45d5a1a391..fb0d156cdbf 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -237,7 +237,7 @@ E = locate() in get_turf(src) if(!E) var/obj/structure/spider/eggcluster/C = new /obj/structure/spider/eggcluster(src.loc) - C.faction = faction + C.faction = faction.Copy() C.master_commander = master_commander if(ckey) C.player_spiders = 1 diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 82a9778ab47..0b0c44868ab 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -67,7 +67,7 @@ var/gold_core_spawnable = CHEM_MOB_SPAWN_INVALID //if CHEM_MOB_SPAWN_HOSTILE can be spawned by plasma with gold core, CHEM_MOB_SPAWN_FRIENDLY are 'friendlies' spawned with blood - var/master_commander = null //holding var for determining who own/controls a sentient simple animal (for sentience potions). + var/mob/living/carbon/human/master_commander = null //holding var for determining who own/controls a sentient simple animal (for sentience potions). var/mob/living/simple_animal/hostile/spawner/nest