Fixed the signpost shuttle bug.

Critters have been added and livestock removed
Xbow damage raised to 30 a shot
Centcom Survival Kit is once again a box
Sec uniforms moved into their own locker

After IRC talk
Guns that are created in the protolathe now spawn inside of a lockbox
They can be unlocked by an ID with Armory access or an Emag.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2045 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
mport2004@gmail.com
2011-08-24 04:00:45 +00:00
parent e3de8ddc34
commit 3cae06c9c3
45 changed files with 3425 additions and 3632 deletions

View File

@@ -0,0 +1,117 @@
/obj/critter
name = "Critter"
desc = "Generic critter."
icon = 'critter.dmi'
icon_state = "basic"
layer = 5.0
density = 1
anchored = 0
var
alive = 1
health = 10
max_health = 10
//AI things
task = "thinking"
//Attacks at will
aggressive = 1
//Will target an attacker
defensive = 0
//Will randomly move about
wanderer = 1
//Will open doors it bumps
opensdoors = 1
//Internal tracking ignore
frustration = 0
max_frustration = 8
attack = 0
attacking = 0
steps = 0
last_found = null
target = null
oldtarget_name = null
target_lastloc = null
//The last guy who attacked it
attacker = null
//Will not attack this thing
friend = null
//How far to look for things dont set this overly high
seekrange = 7
//If true will attack these things
atkcarbon = 1
atksilicon = 0
atkcritter = 0
//Attacks critters of the same type
atksame = 0
atkmech = 0
//Damage multipliers
brutevuln = 1
firevuln = 1
//DR
armor = 0
//How much damage it does it melee
melee_damage_lower = 1
melee_damage_upper = 2
//Basic attack message when they move to attack and attack
angertext = "charges at"
attacktext = "attacks"
proc
patrol_step()
process()
seek_target()
Die()
ChaseAttack()
RunAttack()
TakeDamage(var/damage = 0)
Target_Attacker(var/target)
/* TODO:Go over these and see how/if to add them
proc/set_attack()
state = 1
if(path_idle.len) path_idle = new/list()
trg_idle = null
proc/set_idle()
state = 2
if (path_target.len) path_target = new/list()
target = null
frustration = 0
proc/set_null()
state = 0
if (path_target.len) path_target = new/list()
if (path_idle.len) path_idle = new/list()
target = null
trg_idle = null
frustration = 0
proc/path_idle(var/atom/trg)
path_idle = AStar(src.loc, get_turf(trg), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 250, anicard, null)
path_idle = reverselist(path_idle)
proc/path_attack(var/atom/trg)
path_target = AStar(src.loc, trg.loc, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 250, anicard, null)
path_target = reverselist(path_target)
//Look these over
var/list/path = new/list()
var/patience = 35 //The maximum time it'll chase a target.
var/list/mob/living/carbon/flee_from = new/list()
var/list/path_target = new/list() //The path to the combat target.
var/turf/trg_idle //It's idle target, the one it's following but not attacking.
var/list/path_idle = new/list() //The path to the idle target.
*/

View File

@@ -0,0 +1,186 @@
/obj/critter
New()
spawn(0) process()//I really dont like this much but it seems to work well
..()
process()
set background = 1
if (!src.alive) return
switch(task)
if("thinking")
src.attack = 0
src.target = null
sleep(15)
walk_to(src,0)
if (src.aggressive) seek_target()
if (src.wanderer && !src.target) src.task = "wandering"
if("chasing")
if (src.frustration >= max_frustration)
src.target = null
src.last_found = world.time
src.frustration = 0
src.task = "thinking"
walk_to(src,0)
if (target)
if (get_dist(src, src.target) <= 1)
var/mob/living/carbon/M = src.target
ChaseAttack()
src.task = "attacking"
src.anchored = 1
src.target_lastloc = M.loc
else
var/turf/olddist = get_dist(src, src.target)
walk_to(src, src.target,1,4)
if ((get_dist(src, src.target)) >= (olddist))
src.frustration++
else
src.frustration = 0
sleep(5)
else src.task = "thinking"
if("attacking")
// see if he got away
if ((get_dist(src, src.target) > 1) || ((src.target:loc != src.target_lastloc)))
src.anchored = 0
src.task = "chasing"
else
if (get_dist(src, src.target) <= 1)
var/mob/living/carbon/M = src.target
if(!src.attacking) RunAttack()
if(!src.aggressive)
src.task = "thinking"
src.target = null
src.anchored = 0
src.last_found = world.time
src.frustration = 0
src.attacking = 0
else
if(M!=null)
if(M.health < 0)
src.task = "thinking"
src.target = null
src.anchored = 0
src.last_found = world.time
src.frustration = 0
src.attacking = 0
else
src.anchored = 0
src.attacking = 0
src.task = "chasing"
if("wandering")
patrol_step()
sleep(10)
spawn(8)
process()
return
patrol_step()
var/moveto = locate(src.x + rand(-1,1),src.y + rand(-1, 1),src.z)
if (istype(moveto, /turf/simulated/floor) || istype(moveto, /turf/simulated/shuttle/floor) || istype(moveto, /turf/unsimulated/floor)) step_towards(src, moveto)
if(src.aggressive) seek_target()
steps += 1
if (steps == rand(5,20)) src.task = "thinking"
Bump(M as mob|obj)//TODO: Add access levels here
spawn(0)
if ((istype(M, /obj/machinery/door)))
var/obj/machinery/door/D = M
if (src.opensdoors)
D.open()
src.frustration = 0
else src.frustration ++
else if ((istype(M, /mob/living/)) && (!src.anchored))
src.loc = M:loc
src.frustration = 0
return
return
Bumped(M as mob|obj)
spawn(0)
var/turf/T = get_turf(src)
M:loc = T
seek_target()
src.anchored = 0
var/T = null
for(var/mob/living/C in view(src.seekrange,src))//TODO: mess with this
if (src.target)
src.task = "chasing"
break
if((C.name == src.oldtarget_name) && (world.time < src.last_found + 100)) continue
if(istype(C, /mob/living/carbon/) && !src.atkcarbon) continue
if(istype(C, /mob/living/silicon/) && !src.atksilicon) continue
if(C.health < 0) continue
if(istype(C, /mob/living/carbon/) && src.atkcarbon) src.attack = 1
if(istype(C, /mob/living/silicon/) && src.atksilicon) src.attack = 1
if(src.attack)
T = C
break
if(!src.attack)
for(var/obj/critter/C in view(src.seekrange,src))
if(istype(C, /obj/critter) && !src.atkcritter) continue
if(istype(C, /obj/mecha) && !src.atkmech) continue
if(C.health < 0) continue
if(istype(C, /obj/critter) && src.atkcritter)
if(istype(C, src.type) && !src.atksame) continue
src.attack = 1
if(istype(C, /obj/mecha) && src.atkmech) src.attack = 1
if(src.attack)
T = C
break
if(src.attack)
src.target = T
src.oldtarget_name = T:name
src.task = "chasing"
return
ChaseAttack()
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>[src]</B> [src.angertext] at [src.target]!", 1)
return
RunAttack()
src.attacking = 1
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>[src]</B> [src.attacktext] [src.target]!", 1)
if(ismob(src.target))
src.target:bruteloss += rand(melee_damage_lower,melee_damage_upper)
if(isobj(src.target))
if(istype(target, /obj/mecha))
src.target:take_damage(rand(melee_damage_lower,melee_damage_upper))
else
src.target:TakeDamage(rand(melee_damage_lower,melee_damage_upper))
spawn(25)
src.attacking = 0
return
/*TODO: Figure out how to handle special things like this dont really want to give it to every critter
/obj/critter/proc/CritterTeleport(var/telerange, var/dospark, var/dosmoke)
if (!src.alive) return
var/list/randomturfs = new/list()
for(var/turf/T in orange(src, telerange))
if(istype(T, /turf/space) || T.density) continue
randomturfs.Add(T)
src.loc = pick(randomturfs)
if (dospark)
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
s.set_up(5, 1, src)
s.start()
if (dosmoke)
var/datum/effects/system/harmless_smoke_spread/smoke = new /datum/effects/system/harmless_smoke_spread()
smoke.set_up(10, 0, src.loc)
smoke.start()
src.task = "thinking"
*/

View File

@@ -0,0 +1,166 @@
/obj/critter/creature
name = "creature"
desc = "A sanity-destroying otherthing."
icon = 'otherthing.dmi'
icon_state = "otherthing"
health = 80
max_health = 80
aggressive = 1
defensive = 1
wanderer = 1
opensdoors = 1
atkcarbon = 1
atksilicon = 1
atkcritter = 1
atkmech = 1
atksame = 1
firevuln = 1
brutevuln = 1
melee_damage_lower = 25
melee_damage_upper = 50
angertext = "runs at"
attacktext = "chomps"
/obj/critter/roach
name = "cockroach"
desc = "An unpleasant insect that lives in filthy places."
icon_state = "roach"
health = 5
max_health = 5
aggressive = 0
defensive = 1
wanderer = 1
opensdoors = 0
atkcarbon = 1
atksilicon = 0
attacktext = "bites"
Die()
..()
del(src)
/obj/critter/killertomato
name = "killer tomato"
desc = "Oh shit, you're really fucked now."
icon_state = "killertomato"
health = 15
max_health = 15
aggressive = 1
defensive = 0
wanderer = 1
opensdoors = 1
atkcarbon = 1
atksilicon = 1
firevuln = 2
brutevuln = 2
Die()
..()
new /obj/item/weapon/reagent_containers/food/snacks/tomatomeat(src)
if(prob(50))
new /obj/item/weapon/reagent_containers/food/snacks/tomatomeat(src)
new /obj/item/weapon/reagent_containers/food/snacks/tomatomeat(src)
/obj/critter/spore
name = "plasma spore"
desc = "A barely intelligent colony of organisms. Very volatile."
icon_state = "spore"
density = 1
health = 1
max_health = 1
aggressive = 0
defensive = 0
wanderer = 1
opensdoors = 0
atkcarbon = 0
atksilicon = 0
firevuln = 2
brutevuln = 2
Die()
src.visible_message("<b>[src]</b> ruptures and explodes!")
src.alive = 0
var/turf/T = get_turf(src.loc)
if(T)
T.hotspot_expose(700,125)
explosion(T, -1, -1, 2, 3)
del src
ex_act(severity)
src.Die()
/obj/critter/spesscarp
name = "Spess Carp"
desc = "Oh shit, you're really fucked now."
icon_state = "spesscarp"
health = 25
max_health = 25
aggressive = 1
defensive = 1
wanderer = 1
opensdoors = 1
atkcarbon = 1
atksilicon = 1
atkcritter = 1
atkmech = 1
firevuln = 2
brutevuln = 1
melee_damage_lower = 5
melee_damage_upper = 10
angertext = "swims at"
attacktext = "bites"
Die()
..()
new/obj/item/weapon/reagent_containers/food/snacks/carpmeat(src.loc)
if(prob(50))
new /obj/item/weapon/reagent_containers/food/snacks/carpmeat(src)
new /obj/item/weapon/reagent_containers/food/snacks/carpmeat(src)
/obj/critter/spesscarp/elite
desc = "Oh shit, you're really fucked now. It has an evil gleam in it's eye."
health = 50
max_health = 50
melee_damage_lower = 10
melee_damage_upper = 20
/obj/critter/walkingmushroom
name = "Walking Mushroom"
desc = "A...huge...mushroom...with legs!?"
icon_state = "walkingmushroom"
health = 15
max_health = 15
aggressive = 0
defensive = 0
wanderer = 1
opensdoors = 0
atkcarbon = 0
atksilicon = 0
firevuln = 2
brutevuln = 1
Die()
..()
new /obj/item/weapon/reagent_containers/food/snacks/hugemushroomslice(src.loc)
if(prob(50))
new /obj/item/weapon/reagent_containers/food/snacks/hugemushroomslice(src.loc)
new /obj/item/weapon/reagent_containers/food/snacks/hugemushroomslice(src.loc)
/obj/critter/lizard
name = "Lizard"
desc = "A cute tiny lizard."
icon_state = "lizard"
health = 5
max_health = 5
aggressive = 0
defensive = 1
wanderer = 1
opensdoors = 0
atkcarbon = 1
atksilicon = 1
attacktext = "bites"

View File

@@ -0,0 +1,95 @@
/*
Contains the procs that control attacking critters
*/
/obj/critter
attackby(obj/item/weapon/W as obj, mob/living/user as mob)
..()
if (!src.alive) return
var/damage = 0
switch(W.damtype)
if("fire") damage = W.force * firevuln
if("brute") damage = W.force * brutevuln
TakeDamage(damage)
if(src.defensive) Target_Attacker(user)
return
attack_hand(var/mob/user as mob)
if (!src.alive) ..()
if (user.a_intent == "hurt")
TakeDamage(rand(1,2) * brutevuln)
for(var/mob/O in viewers(src, null))
O.show_message("\red <b>[user]</b> punches [src]!", 1)
playsound(src.loc, pick('punch1.ogg','punch2.ogg','punch3.ogg','punch4.ogg'), 100, 1)
if(src.defensive) Target_Attacker(user)
else
for(var/mob/O in viewers(src, null))
O.show_message("\red <b>[user]</b> touches [src]!", 1)
Target_Attacker(var/target)
if(!target) return
src.target = target
src.oldtarget_name = target:name
for(var/mob/O in viewers(src, null))
O.show_message("\red <b>[src]</b> [src.angertext] [target:name]!", 1)
src.task = "chasing"
return
TakeDamage(var/damage = 0)
var/tempdamage = (damage-armor)
if(tempdamage > 0)
src.health -= tempdamage
else
src.health--
if(src.health <= 0)
src.Die()
Die()//Might be more effective to del them and create a dummy item of some sorts
if (!src.alive) return
src.icon_state += "-dead"
src.alive = 0
src.anchored = 0
src.density = 0
walk_to(src,0)
src.visible_message("<b>[src]</b> dies!")
bullet_act(var/obj/item/projectile/Proj)
TakeDamage(Proj.damage)
ex_act(severity)
switch(severity)
if(1.0)
src.Die()
return
if(2.0)
TakeDamage(20)
return
return
emp_act(serverity)
switch(serverity)
if(1.0)
src.Die()
return
if(2.0)
TakeDamage(20)
return
return
meteorhit()
src.Die()
return
blob_act()
if(prob(25))
src.Die()
return

View File

@@ -0,0 +1,244 @@
/obj/item/projectile/hivebotbullet
damage = 5
mobdamage = list(BRUTE = 5, BURN = 0, TOX = 0, OXY = 0, CLONE = 0)
/obj/critter/hivebot
name = "Hivebot"
desc = "A small robot"
icon = 'hivebot.dmi'
icon_state = "basic"
health = 10
max_health = 10
aggressive = 1
wanderer = 1
opensdoors = 1
atkcarbon = 1
atksilicon = 0
atkcritter = 1
atksame = 0
atkmech = 1
firevuln = 0.5
brutevuln = 1
seekrange = 8
armor = 5
melee_damage_lower = 2
melee_damage_upper = 3
angertext = "leaps at"
attacktext = "claws"
var
ranged = 0
rapid = 0
proc
Shoot(var/target, var/start, var/user, var/bullet = 0)
OpenFire(var/thing)//bluh ill rename this later or somethin
Die()
if (!src.alive) return
src.alive = 0
walk_to(src,0)
src.visible_message("<b>[src]</b> blows apart!")
var/turf/Ts = get_turf(src)
new /obj/decal/cleanable/robot_debris(Ts)
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
s.set_up(3, 1, src)
s.start()
del(src)
seek_target()
src.anchored = 0
var/T = null
for(var/mob/living/C in view(src.seekrange,src))//TODO: mess with this
if (src.target)
src.task = "chasing"
break
if((C.name == src.oldtarget_name) && (world.time < src.last_found + 100)) continue
if(istype(C, /mob/living/carbon/) && !src.atkcarbon) continue
if(istype(C, /mob/living/silicon/) && !src.atksilicon) continue
if(C.health < 0) continue
if(istype(C, /mob/living/carbon/) && src.atkcarbon)
if(C:mind)
if(C:mind:special_role == "H.I.V.E")
continue
src.attack = 1
if(istype(C, /mob/living/silicon/) && src.atksilicon)
if(C:mind)
if(C:mind:special_role == "H.I.V.E")
continue
src.attack = 1
if(src.attack)
T = C
break
if(!src.attack)
for(var/obj/critter/C in view(src.seekrange,src))
if(istype(C, /obj/critter) && !src.atkcritter) continue
if(istype(C, /obj/mecha) && !src.atkmech) continue
if(C.health < 0) continue
if(istype(C, /obj/critter) && src.atkcritter)
if(istype(C, /obj/critter/hivebot) && !src.atksame) continue
src.attack = 1
if(istype(C, /obj/mecha) && src.atkmech) src.attack = 1
if(src.attack)
T = C
break
if(src.attack)
src.target = T
src.oldtarget_name = T:name
if(src.ranged)
OpenFire(T)
return
src.task = "chasing"
return
OpenFire(var/thing)
src.target = thing
src.oldtarget_name = thing:name
for(var/mob/O in viewers(src, null))
O.show_message("\red <b>[src]</b> fires at [src.target]!", 1)
var/tturf = get_turf(target)
if(rapid)
spawn(1)
Shoot(tturf, src.loc, src)
spawn(4)
Shoot(tturf, src.loc, src)
spawn(6)
Shoot(tturf, src.loc, src)
else
Shoot(tturf, src.loc, src)
src.attack = 0
sleep(12)
seek_target()
src.task = "thinking"
return
Shoot(var/target, var/start, var/user, var/bullet = 0)
if(target == start)
return
var/obj/item/projectile/hivebotbullet/A = new /obj/item/projectile/hivebotbullet(user:loc)
playsound(user, 'Gunshot.ogg', 100, 1)
if(!A) return
if (!istype(target, /turf))
del(A)
return
A.current = target
A.yo = target:y - start:y
A.xo = target:x - start:x
spawn( 0 )
A.process()
return
/obj/critter/hivebot/range
name = "Hivebot"
desc = "A smallish robot, this one is armed!"
ranged = 1
/obj/critter/hivebot/rapid
ranged = 1
rapid = 1
/obj/critter/hivebot/strong
name = "Strong Hivebot"
desc = "A robot, this one is armed and looks tough!"
health = 50
armor = 10
ranged = 1
/obj/critter/hivebot/borg
health = 20
atksilicon = 1
ranged = 1
rapid = 1
/obj/critter/hivebot/tele//this still needs work
name = "Beacon"
desc = "Some odd beacon thing"
icon = 'Hivebot.dmi'
icon_state = "def_radar-off"
health = 100
max_health = 100
aggressive = 0
wanderer = 0
opensdoors = 0
atkcarbon = 0
atksilicon = 0
atkcritter = 0
atksame = 0
atkmech = 0
firevuln = 0.5
brutevuln = 1
seekrange = 2
armor = 10
var
bot_type = "norm"
bot_amt = 10
spawn_delay = 600
turn_on = 0
auto_spawn = 1
proc
warpbots()
New()
..()
var/datum/effects/system/harmless_smoke_spread/smoke = new /datum/effects/system/harmless_smoke_spread()
smoke.set_up(5, 0, src.loc)
smoke.start()
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>The [src] warps in!</B>", 1)
playsound(src.loc, 'EMPulse.ogg', 25, 1)
if(auto_spawn)
spawn(spawn_delay)
turn_on = 1
warpbots()
icon_state = "def_radar"
for(var/mob/O in viewers(src, null))
O.show_message("\red The [src] turns on!", 1)
while(bot_amt > 0)
bot_amt--
switch(bot_type)
if("norm")
new /obj/critter/hivebot(get_turf(src))
if("range")
new /obj/critter/hivebot/range(get_turf(src))
if("rapid")
new /obj/critter/hivebot/rapid(get_turf(src))
spawn(100)
del(src)
return
process()
if(health < (max_health/2))
turn_on = 1
if(turn_on)
warpbots()
turn_on = 0
..()
/obj/critter/hivebot/tele/massive
bot_type = "norm"
bot_amt = 30
auto_spawn = 0
/obj/critter/hivebot/tele/ranged
bot_type = "range"
/obj/critter/hivebot/tele/rapid
bot_type = "rapid"
spawn_delay = 800