TG spider port

This commit is contained in:
Fox-McCloud
2015-04-18 10:41:04 -04:00
parent dc571d7e63
commit af925be951
7 changed files with 167 additions and 176 deletions
+53 -44
View File
@@ -22,9 +22,9 @@
/obj/effect/spider/attackby(var/obj/item/weapon/W, var/mob/user, params)
if(W.attack_verb.len)
visible_message("\red <B>\The [src] have been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]")
visible_message("<span class='danger'>[user] has [pick(W.attack_verb)] \the [src] with \the [W]!</span>")
else
visible_message("\red <B>\The [src] have been attacked with \the [W][(user ? " by [user]." : ".")]")
visible_message("<span class='danger'>[user] has attacked \the [src] with \the [W]!</span>")
var/damage = W.force / 4.0
@@ -45,7 +45,7 @@
/obj/effect/spider/proc/healthcheck()
if(health <= 0)
del(src)
qdel(src)
/obj/effect/spider/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
@@ -54,17 +54,18 @@
/obj/effect/spider/stickyweb
icon_state = "stickyweb1"
New()
if(prob(50))
icon_state = "stickyweb2"
/obj/effect/spider/stickyweb/New()
if(prob(50))
icon_state = "stickyweb2"
/obj/effect/spider/stickyweb/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover, /mob/living/simple_animal/hostile/giant_spider))
if(istype(mover, /mob/living/simple_animal/hostile/poison/giant_spider))
return 1
else if(istype(mover, /mob/living))
if(prob(50))
mover << "\red You get stuck in \the [src] for a moment."
mover << "<span class='danger'>You get stuck in \the [src] for a moment.</span>"
return 0
else if(istype(mover, /obj/item/projectile))
return prob(30)
@@ -75,37 +76,40 @@
desc = "They seem to pulse slightly with an inner life"
icon_state = "eggs"
var/amount_grown = 0
New()
pixel_x = rand(3,-3)
pixel_y = rand(3,-3)
processing_objects.Add(src)
var/player_spiders = 0
/obj/effect/spider/eggcluster/New()
pixel_x = rand(3,-3)
pixel_y = rand(3,-3)
processing_objects.Add(src)
/obj/effect/spider/eggcluster/process()
amount_grown += rand(0,2)
if(amount_grown >= 100)
var/num = rand(2,6)
var/num = rand(3,12)
for(var/i=0, i<num, i++)
new /obj/effect/spider/spiderling(src.loc)
del(src)
var/obj/effect/spider/spiderling/S = new /obj/effect/spider/spiderling(src.loc)
if(player_spiders)
S.player_spiders = 1
qdel(src)
/obj/effect/spider/spiderling
name = "spiderling"
desc = "It never stays still for long."
icon_state = "spiderling"
anchored = 0
layer = 2.7
layer = 2.75
health = 3
var/amount_grown = -1
var/amount_grown = 0
var/grow_as = null
var/obj/machinery/atmospherics/unary/vent_pump/entry_vent
var/travelling_in_vent = 0
New()
pixel_x = rand(6,-6)
pixel_y = rand(6,-6)
processing_objects.Add(src)
//50% chance to grow up
if(prob(50))
amount_grown = 1
var/player_spiders = 0
/obj/effect/spider/spiderling/New()
pixel_x = rand(6,-6)
pixel_y = rand(6,-6)
processing_objects.Add(src)
/obj/effect/spider/spiderling/Bump(atom/user)
if(istype(user, /obj/structure/table))
@@ -116,7 +120,7 @@
/obj/effect/spider/spiderling/proc/die()
visible_message("<span class='alert'>[src] dies!</span>")
new /obj/effect/decal/cleanable/spiderling_remains(src.loc)
del(src)
qdel(src)
/obj/effect/spider/spiderling/healthcheck()
if(health <= 0)
@@ -137,8 +141,9 @@
entry_vent = null
return
var/obj/machinery/atmospherics/unary/vent_pump/exit_vent = pick(vents)
/*if(prob(50))
src.visible_message("<B>[src] scrambles into the ventillation ducts!</B>")*/
if(prob(50))
visible_message("<B>[src] scrambles into the ventillation ducts!</B>", \
"<span class='notice'>You hear something squeezing through the ventilation ducts.</span>")
spawn(rand(20,60))
loc = exit_vent
@@ -151,7 +156,7 @@
return
if(prob(50))
src.visible_message("\blue You hear something squeezing through the ventilation ducts.",2)
audible_message("<span class='notice'>You hear something squeezing through the ventilation ducts.</span>")
sleep(travel_time)
if(!exit_vent || exit_vent.welded)
@@ -167,30 +172,34 @@
entry_vent = null
//=================
else if(prob(25))
var/list/nearby = oview(5, src)
else if(prob(33))
var/list/nearby = oview(10, src)
if(nearby.len)
var/target_atom = pick(nearby)
walk_to(src, target_atom, 5)
if(prob(25))
src.visible_message("\blue \the [src] skitters[pick(" away"," around","")].")
else if(prob(5))
walk_to(src, target_atom)
if(prob(40))
src.visible_message("<span class='notice'>\The [src] skitters[pick(" away"," around","")].</span>")
else if(prob(10))
//ventcrawl!
for(var/obj/machinery/atmospherics/unary/vent_pump/v in view(7,src))
if(!v.welded)
entry_vent = v
walk_to(src, entry_vent, 5)
walk_to(src, entry_vent, 1)
break
if(prob(1))
src.visible_message("\blue \the [src] chitters.")
if(isturf(loc) && amount_grown > 0)
if(isturf(loc))
amount_grown += rand(0,2)
if(amount_grown >= 100)
if(!grow_as)
grow_as = pick(typesof(/mob/living/simple_animal/hostile/giant_spider))
new grow_as(src.loc)
del(src)
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)
if(player_spiders)
var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET)
var/client/C = null
if(candidates.len)
C = pick(candidates)
S.key = C.key
qdel(src)
/obj/effect/decal/cleanable/spiderling_remains
name = "spiderling remains"
@@ -204,11 +213,11 @@
icon_state = "cocoon1"
health = 60
New()
/obj/effect/spider/cocoon/New()
icon_state = pick("cocoon1","cocoon2","cocoon3")
/obj/effect/spider/cocoon/Destroy()
src.visible_message("\red \the [src] splits open.")
src.visible_message("<span class='danger'>\The [src] splits open.</span>")
for(var/atom/movable/A in contents)
A.loc = src.loc
..()