mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-24 04:28:12 +01:00
Merge remote-tracking branch 'remotes/git-svn' into bs12_with_tgport
Conflicts: code/game/gamemodes/events.dm code/game/gamemodes/wizard/veilrender.dm code/game/jobs/job/captain.dm code/game/machinery/computer/HolodeckControl.dm code/game/objects/items/stacks/sheets/sheet_types.dm code/game/objects/structures/grille.dm code/modules/mob/living/simple_animal/life.dm code/setup.dm Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
@@ -100,6 +100,11 @@
|
||||
if(!adm_ckey || !new_rank)
|
||||
return
|
||||
|
||||
adm_ckey = ckey(adm_ckey)
|
||||
|
||||
if(!adm_ckey)
|
||||
return
|
||||
|
||||
if(!istext(adm_ckey) || !istext(new_rank))
|
||||
return
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
user.machine = src
|
||||
var/dat = "<B>Bluespace Artillery Control:</B><BR>"
|
||||
dat += "Locked on<BR>"
|
||||
dat += "<B>180 seconds are required to charge between shots:</B><BR>"
|
||||
dat += "<B>Charge progress: [reload]/180:</B><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];fire=1'>Open Fire</A><BR>"
|
||||
dat += "Deployment of weapon authorized by <br>Nanotrasen Naval Command<br><br>Remember, friendly fire is grounds for termination of your contract and life.<HR>"
|
||||
user << browse(dat, "window=scroll")
|
||||
|
||||
@@ -553,7 +553,7 @@
|
||||
|
||||
if(Toxins_pp > safe_toxins_max) // Too much toxins
|
||||
var/ratio = breath.toxins/safe_toxins_max
|
||||
adjustToxLoss(min(ratio, 10)) //Limit amount of damage toxin exposure can do per second
|
||||
adjustToxLoss(min(ratio, MIN_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second
|
||||
toxins_alert = max(toxins_alert, 1)
|
||||
else
|
||||
toxins_alert = 0
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
|
||||
if(Toxins_pp > safe_toxins_max) // Too much toxins
|
||||
var/ratio = breath.toxins/safe_toxins_max
|
||||
adjustToxLoss(min(ratio, 10)) //Limit amount of damage toxin exposure can do per second
|
||||
adjustToxLoss(min(ratio, MIN_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second
|
||||
toxins_alert = max(toxins_alert, 1)
|
||||
else
|
||||
toxins_alert = 0
|
||||
|
||||
@@ -1,182 +0,0 @@
|
||||
#define BEAR_STANCE_IDLE 1
|
||||
#define BEAR_STANCE_ALERT 2
|
||||
#define BEAR_STANCE_ATTACK 3
|
||||
#define BEAR_STANCE_ATTACKING 4
|
||||
#define BEAR_STANCE_TIRED 5
|
||||
|
||||
//Space bears!
|
||||
/mob/living/simple_animal/bear
|
||||
name = "space bear"
|
||||
desc = "RawrRawr!!"
|
||||
icon_state = "bear"
|
||||
icon_living = "bear"
|
||||
icon_dead = "bear_dead"
|
||||
icon_gib = "bear_gib"
|
||||
speak = list("RAWR!","Rawr!","GRR!","Growl!")
|
||||
speak_emote = list("growls", "roars")
|
||||
emote_hear = list("rawrs","grumbles","grawls")
|
||||
emote_see = list("stares ferociously", "stomps")
|
||||
speak_chance = 1
|
||||
turns_per_move = 5
|
||||
see_in_dark = 6
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
response_help = "pets the"
|
||||
response_disarm = "gently pushes aside the"
|
||||
response_harm = "pokes the"
|
||||
stop_automated_movement_when_pulled = 0
|
||||
maxHealth = 60
|
||||
health = 60
|
||||
melee_damage_lower = 20
|
||||
melee_damage_upper = 30
|
||||
|
||||
//Space bears aren't affected by atmos.
|
||||
min_oxy = 0
|
||||
max_oxy = 0
|
||||
min_tox = 0
|
||||
max_tox = 0
|
||||
min_co2 = 0
|
||||
max_co2 = 0
|
||||
min_n2 = 0
|
||||
max_n2 = 0
|
||||
minbodytemp = 0
|
||||
|
||||
var/stance = BEAR_STANCE_IDLE //Used to determine behavior
|
||||
var/stance_step = 0 //Used to delay checks depending on what stance the bear is in
|
||||
var/mob/living/target_mob //Once the bear enters attack stance, it will try to chase this mob. This it to prevent it changing it's mind between multiple mobs.
|
||||
|
||||
//SPACE BEARS! SQUEEEEEEEE~ OW! FUCK! IT BIT MY HAND OFF!!
|
||||
/mob/living/simple_animal/bear/Hudson
|
||||
name = "Hudson"
|
||||
desc = ""
|
||||
response_help = "pets"
|
||||
response_disarm = "gently pushes aside"
|
||||
response_harm = "pokes"
|
||||
|
||||
/mob/living/simple_animal/bear/Life()
|
||||
..()
|
||||
|
||||
if(client) return //Player controlled bears shouldnt be processing AI stuff
|
||||
|
||||
if(stat)
|
||||
walk(src,0)//Stops the movement
|
||||
|
||||
if(!stat)
|
||||
if(loc && istype(loc,/turf/space))
|
||||
icon_state = "bear"
|
||||
else
|
||||
icon_state = "bearfloor"
|
||||
|
||||
switch(stance)
|
||||
if(BEAR_STANCE_IDLE)
|
||||
var/obj/mecha/M = null
|
||||
var/mob/living/L = null
|
||||
stop_automated_movement = 0
|
||||
stance_step++
|
||||
if(stance_step > 5)
|
||||
stance_step = 0
|
||||
for(L in viewers(7,src))
|
||||
if(isbear(L)) continue
|
||||
if(!L.stat)
|
||||
stance = BEAR_STANCE_ALERT
|
||||
target_mob = L
|
||||
break
|
||||
for(M in view(7,src))
|
||||
if (M.occupant)
|
||||
stance = BEAR_STANCE_ALERT
|
||||
target_mob = M
|
||||
break
|
||||
if (target_mob)
|
||||
emote("stares alertly at [target_mob]")
|
||||
|
||||
if(BEAR_STANCE_ALERT)
|
||||
stop_automated_movement = 1
|
||||
var/found_mob = 0
|
||||
if(target_mob in SA_search(target_mob))
|
||||
if(target_mob && !(SA_attackable(target_mob)))
|
||||
stance_step = max(0, stance_step) //If we have not seen a mob in a while, the stance_step will be negative, we need to reset it to 0 as soon as we see a mob again.
|
||||
stance_step++
|
||||
found_mob = 1
|
||||
src.dir = get_dir(src,target_mob) //Keep staring at the mob
|
||||
|
||||
if(stance_step in list(1,4,7)) //every 3 ticks
|
||||
var/action = pick( list( "growls at [target_mob]", "stares angrily at [target_mob]", "prepares to attack [target_mob]", "closely watches [target_mob]" ) )
|
||||
if(action)
|
||||
emote(action)
|
||||
if(!found_mob)
|
||||
stance_step--
|
||||
|
||||
if(stance_step <= -20) //If we have not found a mob for 20-ish ticks, revert to idle mode
|
||||
stance = BEAR_STANCE_IDLE
|
||||
if(stance_step >= 7) //If we have been staring at a mob for 7 ticks,
|
||||
stance = BEAR_STANCE_ATTACK
|
||||
if(BEAR_STANCE_ATTACK) //This one should only be active for one tick,
|
||||
stop_automated_movement = 1
|
||||
if(!target_mob || SA_attackable(target_mob))
|
||||
stance = BEAR_STANCE_ALERT
|
||||
stance_step = 5 //Make it very alert, so it quickly attacks again if a mob returns
|
||||
if(target_mob in SA_search(target_mob))
|
||||
walk_to(src, target_mob, 1, 3)
|
||||
stance = BEAR_STANCE_ATTACKING
|
||||
stance_step = 0
|
||||
if(BEAR_STANCE_ATTACKING)
|
||||
|
||||
stop_automated_movement = 1
|
||||
stance_step++
|
||||
if(!target_mob || SA_attackable(target_mob))
|
||||
stance = BEAR_STANCE_ALERT
|
||||
stance_step = 5 //Make it very alert, so it quickly attacks again if a mob returns
|
||||
return
|
||||
if(!(target_mob in SA_search(target_mob)))
|
||||
stance = BEAR_STANCE_ALERT
|
||||
stance_step = 5 //Make it very alert, so it quickly attacks again if a mob returns
|
||||
target_mob = null
|
||||
return
|
||||
if(get_dist(src, target_mob) <= 1) //Attacking
|
||||
emote( pick( list("slashes at [target_mob]", "bites [target_mob]") ) )
|
||||
|
||||
var/damage = rand(20,30)
|
||||
|
||||
if(ishuman(target_mob))
|
||||
var/mob/living/carbon/human/H = target_mob
|
||||
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
|
||||
var/datum/organ/external/affecting = H.get_organ(ran_zone(dam_zone))
|
||||
H.apply_damage(damage, BRUTE, affecting, H.run_armor_check(affecting, "melee"))
|
||||
else if(isliving(target_mob))
|
||||
var/mob/living/L = target_mob
|
||||
L.adjustBruteLoss(damage)
|
||||
else if(istype(target_mob,/obj/mecha))
|
||||
var/obj/mecha/M = target_mob
|
||||
M.attack_animal(src)
|
||||
|
||||
if(stance_step >= 20) //attacks for 20 ticks, then it gets tired and needs to rest
|
||||
emote( "is worn out and needs to rest" )
|
||||
stance = BEAR_STANCE_TIRED
|
||||
stance_step = 0
|
||||
walk(src, 0) //This stops the bear's walking
|
||||
return
|
||||
if(BEAR_STANCE_TIRED)
|
||||
stop_automated_movement = 1
|
||||
stance_step++
|
||||
if(stance_step >= 10) //rests for 10 ticks
|
||||
if(target_mob && target_mob in SA_search(target_mob))
|
||||
stance = BEAR_STANCE_ATTACK //If the mob he was chasing is still nearby, resume the attack, otherwise go idle.
|
||||
else
|
||||
stance = BEAR_STANCE_IDLE
|
||||
|
||||
|
||||
/mob/living/simple_animal/bear/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(stance != BEAR_STANCE_ATTACK && stance != BEAR_STANCE_ATTACKING)
|
||||
stance = BEAR_STANCE_ALERT
|
||||
stance_step = 6
|
||||
target_mob = user
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/bear/attack_hand(mob/living/carbon/human/M as mob)
|
||||
if(stance != BEAR_STANCE_ATTACK && stance != BEAR_STANCE_ATTACKING)
|
||||
stance = BEAR_STANCE_ALERT
|
||||
stance_step = 6
|
||||
target_mob = M
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/bear/Process_Spacemove(var/check_drift = 0)
|
||||
return //No drifting in space for space bears!
|
||||
@@ -1,128 +0,0 @@
|
||||
#define CARP_STANCE_IDLE 1
|
||||
#define CARP_STANCE_ATTACK 2
|
||||
#define CARP_STANCE_ATTACKING 3
|
||||
|
||||
/mob/living/simple_animal/carp
|
||||
name = "space carp"
|
||||
desc = "A ferocious, fang-bearing creature that resembles a fish."
|
||||
icon_state = "carp"
|
||||
icon_living = "carp"
|
||||
icon_dead = "carp_dead"
|
||||
icon_gib = "carp_gib"
|
||||
speak_chance = 0
|
||||
turns_per_move = 5
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/carpmeat
|
||||
response_help = "pets the"
|
||||
response_disarm = "gently pushes aside the"
|
||||
response_harm = "hits the"
|
||||
speed = -1
|
||||
stop_automated_movement_when_pulled = 0
|
||||
maxHealth = 25
|
||||
health = 25
|
||||
|
||||
harm_intent_damage = 8
|
||||
melee_damage_lower = 15
|
||||
melee_damage_upper = 15
|
||||
attacktext = "bites"
|
||||
attack_sound = 'sound/weapons/bite.ogg'
|
||||
|
||||
//Space carp aren't affected by atmos.
|
||||
min_oxy = 0
|
||||
max_oxy = 0
|
||||
min_tox = 0
|
||||
max_tox = 0
|
||||
min_co2 = 0
|
||||
max_co2 = 0
|
||||
min_n2 = 0
|
||||
max_n2 = 0
|
||||
minbodytemp = 0
|
||||
|
||||
var/stance = CARP_STANCE_IDLE //Used to determine behavior
|
||||
var/stance_step = 0 //Used to delay checks depending on what stance the bear is in
|
||||
var/mob/living/target_mob //Once the bear enters attack stance, it will try to chase this mob. This it to prevent it changing it's mind between multiple mobs.
|
||||
|
||||
/mob/living/simple_animal/carp/Life()
|
||||
if(stat == DEAD)
|
||||
walk(src,0)//STOP FUCKING MOVING GODDAMN
|
||||
if(health > 0)
|
||||
icon_state = icon_living
|
||||
dead_mob_list -= src
|
||||
living_mob_list += src
|
||||
stat = CONSCIOUS
|
||||
density = 1
|
||||
return
|
||||
|
||||
|
||||
if(health < 1)
|
||||
Die()
|
||||
|
||||
if(health > maxHealth)
|
||||
health = maxHealth
|
||||
|
||||
if(!ckey && !stop_automated_movement)
|
||||
if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc.
|
||||
turns_since_move++
|
||||
if(turns_since_move >= turns_per_move)
|
||||
if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled
|
||||
Move(get_step(src,pick(cardinal)))
|
||||
turns_since_move = 0
|
||||
|
||||
if(!stat)
|
||||
switch(stance)
|
||||
if(CARP_STANCE_IDLE)
|
||||
var/obj/mecha/M = null
|
||||
var/mob/living/L = null
|
||||
stop_automated_movement = 0
|
||||
stance_step++
|
||||
if(stance_step > 5)
|
||||
stance_step = 0
|
||||
for(L in viewers(7,src))
|
||||
if(iscarp(L)) continue
|
||||
if(!L.stat)
|
||||
stance = CARP_STANCE_ATTACK
|
||||
target_mob = L
|
||||
break
|
||||
for(M in view(7,src))
|
||||
if (M.occupant)
|
||||
stance = CARP_STANCE_ATTACK
|
||||
target_mob = M
|
||||
break
|
||||
if (target_mob)
|
||||
emote("nashes at [target_mob]")
|
||||
|
||||
if(CARP_STANCE_ATTACK) //This one should only be active for one tick
|
||||
stop_automated_movement = 1
|
||||
if(!target_mob || SA_attackable(target_mob))
|
||||
stance = CARP_STANCE_IDLE
|
||||
stance_step = 5 //Make it very alert, so it quickly attacks again if a mob returns
|
||||
if(target_mob in SA_search(target_mob))
|
||||
walk_to(src, target_mob, 1, 3)
|
||||
stance = CARP_STANCE_ATTACKING
|
||||
stance_step = 0
|
||||
|
||||
if(CARP_STANCE_ATTACKING)
|
||||
stop_automated_movement = 1
|
||||
stance_step++
|
||||
if(!target_mob || SA_attackable(target_mob))
|
||||
stance = CARP_STANCE_IDLE
|
||||
stance_step = 3 //Make it very alert, so it quickly attacks again if a mob returns
|
||||
target_mob = null
|
||||
return
|
||||
if(!(target_mob in SA_search(target_mob)))
|
||||
stance = CARP_STANCE_IDLE
|
||||
stance_step = 1
|
||||
target_mob = null
|
||||
return
|
||||
if(get_dist(src, target_mob) <= 1) //Attacking
|
||||
if(isliving(target_mob))
|
||||
var/mob/living/L = target_mob
|
||||
L.attack_animal(src)
|
||||
if(prob(10))
|
||||
L.Weaken(5)
|
||||
L.visible_message("<span class='danger'>\the [src] knocks down \the [L]!</span>")
|
||||
if(istype(target_mob,/obj/mecha))
|
||||
var/obj/mecha/M = target_mob
|
||||
M.attack_animal(src)
|
||||
|
||||
/mob/living/simple_animal/carp/Process_Spacemove(var/check_drift = 0)
|
||||
return //No drifting in space for space carp! //original comments do not steal
|
||||
@@ -69,19 +69,23 @@
|
||||
switch(stance)
|
||||
if(CLOWN_STANCE_IDLE)
|
||||
if (src.hostile == 0) return
|
||||
var/obj/mecha/M = null
|
||||
var/mob/living/L = null
|
||||
for(L in viewers(7,src))
|
||||
if(isclown(L)) continue
|
||||
if(!L.stat)
|
||||
stance = CLOWN_STANCE_ATTACK
|
||||
target_mob = L
|
||||
break
|
||||
for(M in view(7,src))
|
||||
if (M.occupant)
|
||||
stance = CLOWN_STANCE_ATTACK
|
||||
target_mob = M
|
||||
break
|
||||
for(var/atom/A in view(7,src))
|
||||
if(isclown(A))
|
||||
continue
|
||||
|
||||
if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
if(!L.stat)
|
||||
stance = CLOWN_STANCE_ATTACK
|
||||
target_mob = L
|
||||
break
|
||||
|
||||
if(istype(A, /obj/mecha))
|
||||
var/obj/mecha/M = A
|
||||
if (M.occupant)
|
||||
stance = CLOWN_STANCE_ATTACK
|
||||
target_mob = M
|
||||
break
|
||||
if (target_mob)
|
||||
emote("honks menacingly at [target_mob]")
|
||||
|
||||
@@ -89,7 +93,7 @@
|
||||
stop_automated_movement = 1
|
||||
if(!target_mob || SA_attackable(target_mob))
|
||||
stance = CLOWN_STANCE_IDLE
|
||||
if(target_mob in SA_search(target_mob))
|
||||
if(target_mob in view(7,src))
|
||||
walk_to(src, target_mob, 1, 3)
|
||||
stance = CLOWN_STANCE_ATTACKING
|
||||
|
||||
@@ -99,7 +103,7 @@
|
||||
stance = CLOWN_STANCE_IDLE
|
||||
target_mob = null
|
||||
return
|
||||
if(!(target_mob in SA_search(target_mob)))
|
||||
if(!(target_mob in view(7,src)))
|
||||
stance = CLOWN_STANCE_IDLE
|
||||
target_mob = null
|
||||
return
|
||||
|
||||
+22
@@ -369,6 +369,28 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/corgi/regenerate_icons()
|
||||
overlays = list()
|
||||
|
||||
if(inventory_head)
|
||||
var/head_icon_state = inventory_head.icon_state
|
||||
if(health <= 0)
|
||||
head_icon_state += "2"
|
||||
|
||||
var/icon/head_icon = icon('icons/mob/corgi_head.dmi',head_icon_state)
|
||||
if(head_icon)
|
||||
overlays += head_icon
|
||||
|
||||
if(inventory_back)
|
||||
var/back_icon_state = inventory_back.icon_state
|
||||
if(health <= 0)
|
||||
back_icon_state += "2"
|
||||
|
||||
var/icon/back_icon = icon('icons/mob/corgi_back.dmi',back_icon_state)
|
||||
if(back_icon)
|
||||
overlays += back_icon
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/simple_animal/corgi/puppy
|
||||
@@ -0,0 +1,167 @@
|
||||
//Space bears!
|
||||
/mob/living/simple_animal/hostile/bear
|
||||
name = "space bear"
|
||||
desc = "RawrRawr!!"
|
||||
icon_state = "bear"
|
||||
icon_living = "bear"
|
||||
icon_dead = "bear_dead"
|
||||
icon_gib = "bear_gib"
|
||||
speak = list("RAWR!","Rawr!","GRR!","Growl!")
|
||||
speak_emote = list("growls", "roars")
|
||||
emote_hear = list("rawrs","grumbles","grawls")
|
||||
emote_see = list("stares ferociously", "stomps")
|
||||
speak_chance = 1
|
||||
turns_per_move = 5
|
||||
see_in_dark = 6
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
response_help = "pets the"
|
||||
response_disarm = "gently pushes aside the"
|
||||
response_harm = "pokes the"
|
||||
stop_automated_movement_when_pulled = 0
|
||||
maxHealth = 60
|
||||
health = 60
|
||||
melee_damage_lower = 20
|
||||
melee_damage_upper = 30
|
||||
|
||||
//Space bears aren't affected by atmos.
|
||||
min_oxy = 0
|
||||
max_oxy = 0
|
||||
min_tox = 0
|
||||
max_tox = 0
|
||||
min_co2 = 0
|
||||
max_co2 = 0
|
||||
min_n2 = 0
|
||||
max_n2 = 0
|
||||
minbodytemp = 0
|
||||
|
||||
//SPACE BEARS! SQUEEEEEEEE~ OW! FUCK! IT BIT MY HAND OFF!!
|
||||
/mob/living/simple_animal/hostile/bear/Hudson
|
||||
name = "Hudson"
|
||||
desc = ""
|
||||
response_help = "pets"
|
||||
response_disarm = "gently pushes aside"
|
||||
response_harm = "pokes"
|
||||
|
||||
/mob/living/simple_animal/hostile/bear/Life()
|
||||
. =..()
|
||||
if(!.)
|
||||
return
|
||||
|
||||
if(loc && istype(loc,/turf/space))
|
||||
icon_state = "bear"
|
||||
else
|
||||
icon_state = "bearfloor"
|
||||
|
||||
switch(stance)
|
||||
|
||||
if(HOSTILE_STANCE_TIRED)
|
||||
stop_automated_movement = 1
|
||||
stance_step++
|
||||
if(stance_step >= 10) //rests for 10 ticks
|
||||
if(target_mob && target_mob in ListTargets())
|
||||
stance = HOSTILE_STANCE_ATTACK //If the mob he was chasing is still nearby, resume the attack, otherwise go idle.
|
||||
else
|
||||
stance = HOSTILE_STANCE_IDLE
|
||||
|
||||
if(HOSTILE_STANCE_ALERT)
|
||||
stop_automated_movement = 1
|
||||
var/found_mob = 0
|
||||
if(target_mob && target_mob in ListTargets())
|
||||
if(!(SA_attackable(target_mob)))
|
||||
stance_step = max(0, stance_step) //If we have not seen a mob in a while, the stance_step will be negative, we need to reset it to 0 as soon as we see a mob again.
|
||||
stance_step++
|
||||
found_mob = 1
|
||||
src.dir = get_dir(src,target_mob) //Keep staring at the mob
|
||||
|
||||
if(stance_step in list(1,4,7)) //every 3 ticks
|
||||
var/action = pick( list( "growls at [target_mob]", "stares angrily at [target_mob]", "prepares to attack [target_mob]", "closely watches [target_mob]" ) )
|
||||
if(action)
|
||||
emote(action)
|
||||
if(!found_mob)
|
||||
stance_step--
|
||||
|
||||
if(stance_step <= -20) //If we have not found a mob for 20-ish ticks, revert to idle mode
|
||||
stance = HOSTILE_STANCE_IDLE
|
||||
if(stance_step >= 7) //If we have been staring at a mob for 7 ticks,
|
||||
stance = HOSTILE_STANCE_ATTACK
|
||||
|
||||
if(HOSTILE_STANCE_ATTACKING)
|
||||
if(stance_step >= 20) //attacks for 20 ticks, then it gets tired and needs to rest
|
||||
emote( "is worn out and needs to rest" )
|
||||
stance = HOSTILE_STANCE_TIRED
|
||||
stance_step = 0
|
||||
walk(src, 0) //This stops the bear's walking
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/bear/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(stance != HOSTILE_STANCE_ATTACK && stance != HOSTILE_STANCE_ATTACKING)
|
||||
stance = HOSTILE_STANCE_ALERT
|
||||
stance_step = 6
|
||||
target_mob = user
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/bear/attack_hand(mob/living/carbon/human/M as mob)
|
||||
if(stance != HOSTILE_STANCE_ATTACK && stance != HOSTILE_STANCE_ATTACKING)
|
||||
stance = HOSTILE_STANCE_ALERT
|
||||
stance_step = 6
|
||||
target_mob = M
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/bear/Process_Spacemove(var/check_drift = 0)
|
||||
return //No drifting in space for space bears!
|
||||
|
||||
/mob/living/simple_animal/hostile/bear/FindTarget()
|
||||
. = ..()
|
||||
if(.)
|
||||
emote("stares alertly at [.]")
|
||||
stance = HOSTILE_STANCE_ALERT
|
||||
|
||||
/mob/living/simple_animal/hostile/bear/LoseTarget()
|
||||
..(5)
|
||||
|
||||
/mob/living/simple_animal/hostile/bear/AttackingTarget()
|
||||
emote( pick( list("slashes at [target_mob]", "bites [target_mob]") ) )
|
||||
|
||||
var/damage = rand(20,30)
|
||||
|
||||
if(ishuman(target_mob))
|
||||
var/mob/living/carbon/human/H = target_mob
|
||||
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
|
||||
var/datum/organ/external/affecting = H.get_organ(ran_zone(dam_zone))
|
||||
H.apply_damage(damage, BRUTE, affecting, H.run_armor_check(affecting, "melee"))
|
||||
return H
|
||||
else if(isliving(target_mob))
|
||||
var/mob/living/L = target_mob
|
||||
L.adjustBruteLoss(damage)
|
||||
return L
|
||||
else if(istype(target_mob,/obj/mecha))
|
||||
var/obj/mecha/M = target_mob
|
||||
M.attack_animal(src)
|
||||
return M
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/carp
|
||||
name = "space carp"
|
||||
desc = "A ferocious, fang-bearing creature that resembles a fish."
|
||||
icon_state = "carp"
|
||||
icon_living = "carp"
|
||||
icon_dead = "carp_dead"
|
||||
icon_gib = "carp_gib"
|
||||
speak_chance = 0
|
||||
turns_per_move = 5
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/carpmeat
|
||||
response_help = "pets the"
|
||||
response_disarm = "gently pushes aside the"
|
||||
response_harm = "hits the"
|
||||
speed = -1
|
||||
stop_automated_movement_when_pulled = 0
|
||||
maxHealth = 25
|
||||
health = 25
|
||||
|
||||
harm_intent_damage = 8
|
||||
melee_damage_lower = 15
|
||||
melee_damage_upper = 15
|
||||
attacktext = "bites"
|
||||
attack_sound = 'sound/weapons/bite.ogg'
|
||||
|
||||
//Space carp aren't affected by atmos.
|
||||
min_oxy = 0
|
||||
max_oxy = 0
|
||||
min_tox = 0
|
||||
max_tox = 0
|
||||
min_co2 = 0
|
||||
max_co2 = 0
|
||||
min_n2 = 0
|
||||
max_n2 = 0
|
||||
minbodytemp = 0
|
||||
|
||||
/mob/living/simple_animal/hostile/carp/Process_Spacemove(var/check_drift = 0)
|
||||
return //No drifting in space for space carp! //original comments do not steal
|
||||
|
||||
/mob/living/simple_animal/hostile/carp/FindTarget()
|
||||
. = ..()
|
||||
if(.)
|
||||
emote("nashes at [.]")
|
||||
|
||||
/mob/living/simple_animal/hostile/carp/AttackingTarget()
|
||||
. =..()
|
||||
var/mob/living/L = .
|
||||
if(istype(L))
|
||||
if(prob(15))
|
||||
L.Weaken(3)
|
||||
L.visible_message("<span class='danger'>\the [src] knocks down \the [L]!</span>")
|
||||
@@ -0,0 +1,103 @@
|
||||
/mob/living/simple_animal/hostile
|
||||
|
||||
var/stance = HOSTILE_STANCE_IDLE //Used to determine behavior
|
||||
var/stance_step = 0 //Used to delay checks depending on what stance the hostile
|
||||
var/mob/living/target_mob //Once the bear enters attack stance, it will try to chase this mob. This it to prevent it changing it's mind between multiple mobs.
|
||||
var/attack_same = 0
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/FindTarget()
|
||||
|
||||
var/atom/T = null
|
||||
stop_automated_movement = 0
|
||||
stance_step++
|
||||
if(stance_step > 5)
|
||||
stance_step = 0
|
||||
for(var/atom/A in ListTargets())
|
||||
|
||||
if(!attack_same && istype(A, src.type))
|
||||
continue
|
||||
|
||||
if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
if(!L.stat)
|
||||
stance = HOSTILE_STANCE_ATTACK
|
||||
T = L
|
||||
break
|
||||
if(istype(A, /obj/mecha))
|
||||
var/obj/mecha/M = A
|
||||
if (M.occupant)
|
||||
stance = HOSTILE_STANCE_ATTACK
|
||||
T = M
|
||||
break
|
||||
return T
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/MoveToTarget(var/step = 5)
|
||||
stop_automated_movement = 1
|
||||
if(!target_mob || SA_attackable(target_mob))
|
||||
stance = HOSTILE_STANCE_IDLE
|
||||
stance_step = step //Make it very alert, so it quickly attacks again if a mob returns
|
||||
if(target_mob in ListTargets())
|
||||
walk_to(src, target_mob, 1, 3)
|
||||
stance = HOSTILE_STANCE_ATTACKING
|
||||
stance_step = 0
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/AttackTarget()
|
||||
|
||||
stop_automated_movement = 1
|
||||
stance_step++
|
||||
if(!target_mob || SA_attackable(target_mob))
|
||||
LoseTarget()
|
||||
return
|
||||
if(!(target_mob in ListTargets()))
|
||||
LostTarget()
|
||||
return
|
||||
if(get_dist(src, target_mob) <= 1) //Attacking
|
||||
AttackingTarget()
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/AttackingTarget()
|
||||
if(isliving(target_mob))
|
||||
var/mob/living/L = target_mob
|
||||
L.attack_animal(src)
|
||||
return L
|
||||
if(istype(target_mob,/obj/mecha))
|
||||
var/obj/mecha/M = target_mob
|
||||
M.attack_animal(src)
|
||||
return M
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/LoseTarget(var/step = 3)
|
||||
stance = HOSTILE_STANCE_IDLE
|
||||
stance_step = step
|
||||
target_mob = null
|
||||
walk(src, 0)
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/LostTarget(var/step = 1)
|
||||
stance = HOSTILE_STANCE_IDLE
|
||||
stance_step = step
|
||||
walk(src, 0)
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/ListTargets()
|
||||
return view(src, 7)
|
||||
|
||||
/mob/living/simple_animal/hostile/Die()
|
||||
..()
|
||||
walk(src, 0)
|
||||
|
||||
/mob/living/simple_animal/hostile/Life()
|
||||
|
||||
. = ..()
|
||||
if(!.)
|
||||
walk(src, 0)
|
||||
return 0
|
||||
if(client)
|
||||
return 0
|
||||
if(!stat)
|
||||
switch(stance)
|
||||
if(HOSTILE_STANCE_IDLE)
|
||||
target_mob = FindTarget()
|
||||
|
||||
if(HOSTILE_STANCE_ATTACK) //This one should only be active for one tick
|
||||
MoveToTarget()
|
||||
|
||||
if(HOSTILE_STANCE_ATTACKING)
|
||||
AttackTarget()
|
||||
@@ -1,438 +0,0 @@
|
||||
/mob/living/simple_animal
|
||||
name = "animal"
|
||||
icon = 'icons/mob/animal.dmi'
|
||||
health = 20
|
||||
maxHealth = 20
|
||||
|
||||
var/icon_living = ""
|
||||
var/icon_dead = ""
|
||||
var/icon_gib = null //We only try to show a gibbing animation if this exists.
|
||||
|
||||
var/list/speak = list()
|
||||
var/list/speak_emote = list()// Emotes while speaking IE: Ian [emote], [text] -- Ian barks, "WOOF!". Spoken text is generated from the speak variable.
|
||||
var/speak_chance = 0
|
||||
var/list/emote_hear = list() //Hearable emotes
|
||||
var/list/emote_see = list() //Unlike speak_emote, the list of things in this variable only show by themselves with no spoken text. IE: Ian barks, Ian yaps
|
||||
|
||||
var/turns_per_move = 1
|
||||
var/turns_since_move = 0
|
||||
universal_speak = 1
|
||||
var/meat_amount = 0
|
||||
var/meat_type
|
||||
var/stop_automated_movement = 0 //Use this to temporarely stop random movement or to if you write special movement code for animals.
|
||||
var/stop_automated_movement_when_pulled = 1 //When set to 1 this stops the animal from moving when someone is pulling it.
|
||||
|
||||
//Interaction
|
||||
var/response_help = "You try to help"
|
||||
var/response_disarm = "You try to disarm"
|
||||
var/response_harm = "You try to hurt"
|
||||
var/harm_intent_damage = 3
|
||||
|
||||
//Temperature effect
|
||||
var/minbodytemp = 250
|
||||
var/maxbodytemp = 350
|
||||
var/heat_damage_per_tick = 3 //amount of damage applied if animal's body temperature is higher than maxbodytemp
|
||||
var/cold_damage_per_tick = 2 //same as heat_damage_per_tick, only if the bodytemperature it's lower than minbodytemp
|
||||
|
||||
//Atmos effect - Yes, you can make creatures that require plasma or co2 to survive. N2O is a trace gas and handled separately, hence why it isn't here. It'd be hard to add it. Hard and me don't mix (Yes, yes make all the dick jokes you want with that.) - Errorage
|
||||
var/min_oxy = 5
|
||||
var/max_oxy = 0 //Leaving something at 0 means it's off - has no maximum
|
||||
var/min_tox = 0
|
||||
var/max_tox = 1
|
||||
var/min_co2 = 0
|
||||
var/max_co2 = 5
|
||||
var/min_n2 = 0
|
||||
var/max_n2 = 0
|
||||
var/unsuitable_atoms_damage = 2 //This damage is taken when atmos doesn't fit all the requirements above
|
||||
|
||||
|
||||
//LETTING SIMPLE ANIMALS ATTACK? WHAT COULD GO WRONG. Defaults to zero so Ian can still be cuddly
|
||||
var/melee_damage_lower = 0
|
||||
var/melee_damage_upper = 0
|
||||
var/attacktext = "attacks"
|
||||
var/attack_sound = null
|
||||
var/friendly = "nuzzles" //If the mob does no damage with it's attack
|
||||
var/wall_smash = 0 //if they can smash walls
|
||||
|
||||
var/speed = 0 //LETS SEE IF I CAN SET SPEEDS FOR SIMPLE MOBS WITHOUT DESTROYING EVERYTHING. Higher speed is slower, negative speed is faster
|
||||
|
||||
/mob/living/simple_animal/New()
|
||||
..()
|
||||
verbs -= /mob/verb/observe
|
||||
|
||||
/mob/living/simple_animal/Login()
|
||||
if(src && src.client)
|
||||
src.client.screen = null
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/Life()
|
||||
|
||||
//Health
|
||||
if(stat == DEAD)
|
||||
if(health > 0)
|
||||
icon_state = icon_living
|
||||
dead_mob_list -= src
|
||||
living_mob_list += src
|
||||
stat = CONSCIOUS
|
||||
density = 1
|
||||
return
|
||||
|
||||
|
||||
if(health < 1)
|
||||
Die()
|
||||
|
||||
if(health > maxHealth)
|
||||
health = maxHealth
|
||||
|
||||
if(stunned)
|
||||
AdjustStunned(-1)
|
||||
if(weakened)
|
||||
AdjustWeakened(-1)
|
||||
if(paralysis)
|
||||
AdjustParalysis(-1)
|
||||
|
||||
//Movement
|
||||
if(!client && !stop_automated_movement)
|
||||
if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc.
|
||||
turns_since_move++
|
||||
if(turns_since_move >= turns_per_move)
|
||||
if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled
|
||||
Move(get_step(src,pick(cardinal)))
|
||||
turns_since_move = 0
|
||||
|
||||
//Speaking
|
||||
if(!client && speak_chance)
|
||||
if(rand(0,200) < speak_chance)
|
||||
if(speak && speak.len)
|
||||
if((emote_hear && emote_hear.len) || (emote_see && emote_see.len))
|
||||
var/length = speak.len
|
||||
if(emote_hear && emote_hear.len)
|
||||
length += emote_hear.len
|
||||
if(emote_see && emote_see.len)
|
||||
length += emote_see.len
|
||||
var/randomValue = rand(1,length)
|
||||
if(randomValue <= speak.len)
|
||||
say(pick(speak))
|
||||
else
|
||||
randomValue -= speak.len
|
||||
if(emote_see && randomValue <= emote_see.len)
|
||||
emote(pick(emote_see),1)
|
||||
else
|
||||
emote(pick(emote_hear),2)
|
||||
else
|
||||
say(pick(speak))
|
||||
else
|
||||
if(!(emote_hear && emote_hear.len) && (emote_see && emote_see.len))
|
||||
emote(pick(emote_see),1)
|
||||
if((emote_hear && emote_hear.len) && !(emote_see && emote_see.len))
|
||||
emote(pick(emote_hear),2)
|
||||
if((emote_hear && emote_hear.len) && (emote_see && emote_see.len))
|
||||
var/length = emote_hear.len + emote_see.len
|
||||
var/pick = rand(1,length)
|
||||
if(pick <= emote_see.len)
|
||||
emote(pick(emote_see),1)
|
||||
else
|
||||
emote(pick(emote_hear),2)
|
||||
|
||||
|
||||
//Atmos
|
||||
var/atmos_suitable = 1
|
||||
|
||||
var/atom/A = src.loc
|
||||
if(isturf(A))
|
||||
var/turf/T = A
|
||||
var/areatemp = T.temperature
|
||||
if( abs(areatemp - bodytemperature) > 40 )
|
||||
var/diff = areatemp - bodytemperature
|
||||
diff = diff / 5
|
||||
//world << "changed from [bodytemperature] by [diff] to [bodytemperature + diff]"
|
||||
bodytemperature += diff
|
||||
|
||||
if(istype(T,/turf/simulated))
|
||||
var/turf/simulated/ST = T
|
||||
if(ST.air)
|
||||
var/tox = ST.air.toxins
|
||||
var/oxy = ST.air.oxygen
|
||||
var/n2 = ST.air.nitrogen
|
||||
var/co2 = ST.air.carbon_dioxide
|
||||
|
||||
if(min_oxy)
|
||||
if(oxy < min_oxy)
|
||||
atmos_suitable = 0
|
||||
if(max_oxy)
|
||||
if(oxy > max_oxy)
|
||||
atmos_suitable = 0
|
||||
if(min_tox)
|
||||
if(tox < min_tox)
|
||||
atmos_suitable = 0
|
||||
if(max_tox)
|
||||
if(tox > max_tox)
|
||||
atmos_suitable = 0
|
||||
if(min_n2)
|
||||
if(n2 < min_n2)
|
||||
atmos_suitable = 0
|
||||
if(max_n2)
|
||||
if(n2 > max_n2)
|
||||
atmos_suitable = 0
|
||||
if(min_co2)
|
||||
if(co2 < min_co2)
|
||||
atmos_suitable = 0
|
||||
if(max_co2)
|
||||
if(co2 > max_co2)
|
||||
atmos_suitable = 0
|
||||
|
||||
//Atmos effect
|
||||
if(bodytemperature < minbodytemp)
|
||||
health -= cold_damage_per_tick
|
||||
else if(bodytemperature > maxbodytemp)
|
||||
health -= heat_damage_per_tick
|
||||
|
||||
if(!atmos_suitable)
|
||||
health -= unsuitable_atoms_damage
|
||||
|
||||
/mob/living/simple_animal/Bumped(AM as mob|obj)
|
||||
if(!AM) return
|
||||
|
||||
if(resting || buckled)
|
||||
return
|
||||
|
||||
if(isturf(src.loc))
|
||||
if(ismob(AM))
|
||||
var/newamloc = src.loc
|
||||
src.loc = AM:loc
|
||||
AM:loc = newamloc
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/gib()
|
||||
if(icon_gib)
|
||||
flick(icon_gib, src)
|
||||
if(meat_amount && meat_type)
|
||||
for(var/i = 0; i < meat_amount; i++)
|
||||
new meat_type(src.loc)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/say_quote(var/text)
|
||||
if(speak_emote && speak_emote.len)
|
||||
var/emote = pick(speak_emote)
|
||||
if(emote)
|
||||
return "[emote], \"[text]\""
|
||||
return "says, \"[text]\"";
|
||||
|
||||
/mob/living/simple_animal/emote(var/act)
|
||||
if(act)
|
||||
if(act == "scream") act = "makes a loud and pained whimper" //ugly hack to stop animals screaming when crushed :P
|
||||
for (var/mob/O in viewers(src, null))
|
||||
O.show_message("<B>[src]</B> [act].")
|
||||
|
||||
|
||||
/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0)
|
||||
M.emote("[M.friendly] [src]")
|
||||
else
|
||||
if(M.attack_sound)
|
||||
playsound(loc, M.attack_sound, 50, 1, 1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("\red <B>[M]</B> [M.attacktext] [src]!", 1)
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name] ([src.ckey])</font>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [M.name] ([M.ckey])</font>")
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
health -= damage
|
||||
|
||||
/mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!Proj) return
|
||||
src.health -= Proj.damage
|
||||
return 0
|
||||
|
||||
/mob/living/simple_animal/attack_hand(mob/living/carbon/human/M as mob)
|
||||
..()
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if("help")
|
||||
if (health > 0)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("\blue [M] [response_help] [src]")
|
||||
|
||||
if("grab")
|
||||
if (M == src)
|
||||
return
|
||||
if (nopush)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
|
||||
|
||||
if("hurt")
|
||||
health -= harm_intent_damage
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("\red [M] [response_harm] [src]")
|
||||
|
||||
if("disarm")
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("\blue [M] [response_disarm] [src]")
|
||||
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if ("help")
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\blue [M] caresses [src] with its scythe like arm."), 1)
|
||||
if ("grab")
|
||||
if(M == src)
|
||||
return
|
||||
if (nopush)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
|
||||
|
||||
if("hurt")
|
||||
var/damage = rand(15, 30)
|
||||
visible_message("\red <B>[M] has slashed at [src]!</B>")
|
||||
src.health -= damage
|
||||
|
||||
|
||||
if("disarm")
|
||||
var/damage = rand(15, 30)
|
||||
visible_message("\red <B>[M] has slashed at [src]!</B>")
|
||||
src.health -= damage
|
||||
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/attack_larva(mob/living/carbon/alien/larva/L as mob)
|
||||
|
||||
switch(L.a_intent)
|
||||
if("help")
|
||||
visible_message("\blue [L] rubs it's head against [src]")
|
||||
|
||||
else
|
||||
|
||||
var/damage = rand(5, 10)
|
||||
visible_message("\red <B>[L] bites [src]!</B>")
|
||||
|
||||
if(stat != DEAD)
|
||||
src.health -= damage
|
||||
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
|
||||
|
||||
|
||||
/mob/living/simple_animal/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
|
||||
if(istype(O, /obj/item/stack/medical))
|
||||
if(stat != DEAD)
|
||||
var/obj/item/stack/medical/MED = O
|
||||
if(health < maxHealth)
|
||||
if(MED.amount >= 1)
|
||||
health = min(maxHealth, health + MED.heal_brute)
|
||||
MED.amount -= 1
|
||||
if(MED.amount <= 0)
|
||||
del(MED)
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if ((M.client && !( M.blinded )))
|
||||
M.show_message("\blue [user] applies the [MED] on [src]")
|
||||
else
|
||||
user << "\blue this [src] is dead, medical items won't bring it back to life."
|
||||
if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead.
|
||||
if(istype(O, /obj/item/weapon/kitchenknife) || istype(O, /obj/item/weapon/butch))
|
||||
new meat_type (get_turf(src))
|
||||
if(prob(95))
|
||||
del(src)
|
||||
return
|
||||
gib()
|
||||
else
|
||||
if(O.force)
|
||||
var/damage = O.force
|
||||
if (O.damtype == HALLOSS)
|
||||
damage = 0
|
||||
health -= damage
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if ((M.client && !( M.blinded )))
|
||||
M.show_message("\red \b [src] has been attacked with the [O] by [user]. ")
|
||||
else
|
||||
usr << "\red This weapon is ineffective, it does no damage."
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if ((M.client && !( M.blinded )))
|
||||
M.show_message("\red [user] gently taps [src] with the [O]. ")
|
||||
|
||||
|
||||
/mob/living/simple_animal/movement_delay()
|
||||
var/tally = 0 //Incase I need to add stuff other than "speed" later
|
||||
|
||||
tally = speed
|
||||
|
||||
return tally+config.animal_delay
|
||||
|
||||
/mob/living/simple_animal/Stat()
|
||||
..()
|
||||
|
||||
statpanel("Status")
|
||||
stat(null, "Health: [round((health / maxHealth) * 100)]%")
|
||||
|
||||
/mob/living/simple_animal/proc/Die()
|
||||
living_mob_list -= src
|
||||
dead_mob_list += src
|
||||
icon_state = icon_dead
|
||||
stat = DEAD
|
||||
density = 0
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/ex_act(severity)
|
||||
if(!blinded)
|
||||
flick("flash", flash)
|
||||
switch (severity)
|
||||
if (1.0)
|
||||
health -= 500
|
||||
gib()
|
||||
return
|
||||
|
||||
if (2.0)
|
||||
health -= 60
|
||||
|
||||
|
||||
if(3.0)
|
||||
health -= 30
|
||||
|
||||
/mob/living/simple_animal/adjustBruteLoss(damage)
|
||||
health -= damage
|
||||
|
||||
|
||||
/mob/living/simple_animal/proc/SA_search(target_mob)
|
||||
if(isliving(target_mob))
|
||||
return (viewers(7,src))
|
||||
if(istype(target_mob,/obj))
|
||||
return (view(7,src))
|
||||
|
||||
/mob/living/simple_animal/proc/SA_attackable(target_mob)
|
||||
if (isliving(target_mob))
|
||||
var/mob/living/L = target_mob
|
||||
if(!L.stat)
|
||||
return (0)
|
||||
if (istype(target_mob,/obj/mecha))
|
||||
var/obj/mecha/M = target_mob
|
||||
if (M.occupant)
|
||||
return (0)
|
||||
return (1)
|
||||
@@ -48,12 +48,14 @@
|
||||
response_harm = "swats the"
|
||||
stop_automated_movement = 1
|
||||
|
||||
|
||||
var/parrot_state = PARROT_WANDER //Hunt for a perch when created
|
||||
var/parrot_sleep_max = 25 //The time the parrot sits while perched before looking around. Mosly a way to avoid the parrot's AI in life() being run every single tick.
|
||||
var/parrot_sleep_dur = 25 //Same as above, this is the var that physically counts down
|
||||
var/parrot_dam_zone = list("chest", "head", "l_arm", "l_leg", "r_arm", "r_leg") //For humans, select a bodypart to attack
|
||||
|
||||
var/parrot_speed = 5 //"Delay in world ticks between movement." Yeah, that's BS but it does directly affect movement. Higher number = slower.
|
||||
var/parrot_been_shot = 0 //Parrots get a speed bonus after being shot. This will deincrement every Life() and at 0 the parrot will return to regular speed.
|
||||
|
||||
var/list/speech_buffer = list()
|
||||
var/list/available_channels = list()
|
||||
|
||||
@@ -91,7 +93,6 @@
|
||||
|
||||
|
||||
/mob/living/simple_animal/parrot/New()
|
||||
usr << "\red Parrots are still a work in progress, use at your own risk."
|
||||
..()
|
||||
parrot_sleep_dur = parrot_sleep_max //In case someone decides to change the max without changing the duration var
|
||||
verbs.Add(/mob/living/simple_animal/parrot/proc/steal_from_ground, \
|
||||
@@ -267,6 +268,7 @@
|
||||
|
||||
parrot_interest = null
|
||||
parrot_state = PARROT_WANDER //OWFUCK, Been shot! RUN LIKE HELL!
|
||||
parrot_been_shot += 5
|
||||
icon_state = "parrot_fly"
|
||||
drop_held_item(0)
|
||||
return
|
||||
@@ -291,6 +293,7 @@
|
||||
if(!isturf(src.loc) || !canmove || buckled)
|
||||
return //If it can't move, dont let it move. (The buckled check probably isn't necessary thanks to canmove)
|
||||
|
||||
|
||||
//-----SPEECH
|
||||
/* Parrot speech mimickry!
|
||||
Phrases that the parrot hears in mob/living/say() get added to speach_buffer.
|
||||
@@ -304,7 +307,6 @@
|
||||
clearlist(speech_buffer)
|
||||
|
||||
|
||||
//Alright, here we go... down the slope
|
||||
|
||||
//-----SLEEPING
|
||||
if(parrot_state == PARROT_PERCH)
|
||||
@@ -419,11 +421,7 @@
|
||||
parrot_state = PARROT_SWOOP | PARROT_RETURN
|
||||
return
|
||||
|
||||
var/oldloc = src.loc
|
||||
step_towards(src, get_step_towards(src,parrot_interest))
|
||||
if(src.loc == oldloc) //Check if the mob is stuck
|
||||
parrot_state = PARROT_WANDER //and demonstrate your amazing obstical avoidance AI
|
||||
|
||||
walk_to(src, parrot_interest, 1, parrot_speed)
|
||||
return
|
||||
|
||||
//-----RETURNING TO PERCH
|
||||
@@ -441,10 +439,7 @@
|
||||
icon_state = "parrot_sit"
|
||||
return
|
||||
|
||||
var/oldloc = src.loc
|
||||
step_towards(src, get_step_towards(src,parrot_perch))
|
||||
if(src.loc == oldloc) //Check if the mob is stuck
|
||||
parrot_state = PARROT_WANDER //and demonstrate your amazing obstical avoidance AI
|
||||
walk_to(src, parrot_perch, 1, parrot_speed)
|
||||
return
|
||||
|
||||
//-----FLEEING
|
||||
@@ -453,10 +448,9 @@
|
||||
if(!parrot_interest || !isliving(parrot_interest)) //Sanity
|
||||
parrot_state = PARROT_WANDER
|
||||
|
||||
var/oldloc = src.loc
|
||||
step(src, get_step_away(src, parrot_interest))
|
||||
if(src.loc == oldloc) //Check if the mob is stuck
|
||||
parrot_state = PARROT_WANDER //and demonstrate your amazing obstical avoidance AI
|
||||
walk_away(src, parrot_interest, 1, parrot_speed-parrot_been_shot)
|
||||
parrot_been_shot--
|
||||
return
|
||||
|
||||
//-----ATTACKING
|
||||
else if(parrot_state == (PARROT_SWOOP | PARROT_ATTACK))
|
||||
@@ -502,11 +496,8 @@
|
||||
|
||||
//Otherwise, fly towards the mob!
|
||||
else
|
||||
var/oldloc = src.loc
|
||||
step_towards(src, get_step_towards(src,parrot_interest))
|
||||
if(src.loc == oldloc) //Check if the mob is stuck
|
||||
parrot_state = PARROT_WANDER //and demonstrate your amazing obstical avoidance AI
|
||||
|
||||
walk_to(src, parrot_interest, 1, parrot_speed)
|
||||
return
|
||||
//-----STATE MISHAP
|
||||
else //This should not happen. If it does lets reset everything and try again
|
||||
walk(src,0)
|
||||
@@ -686,6 +677,7 @@
|
||||
src.loc = AM.loc
|
||||
icon_state = "parrot_sit"
|
||||
return
|
||||
src << "\red There is no perch nearby to sit on."
|
||||
return
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,2 +1,435 @@
|
||||
/mob/living/simple_animal
|
||||
name = "animal"
|
||||
icon = 'icons/mob/animal.dmi'
|
||||
health = 20
|
||||
maxHealth = 20
|
||||
|
||||
var/icon_living = ""
|
||||
var/icon_dead = ""
|
||||
var/icon_gib = null //We only try to show a gibbing animation if this exists.
|
||||
|
||||
var/list/speak = list()
|
||||
var/list/speak_emote = list()// Emotes while speaking IE: Ian [emote], [text] -- Ian barks, "WOOF!". Spoken text is generated from the speak variable.
|
||||
var/speak_chance = 0
|
||||
var/list/emote_hear = list() //Hearable emotes
|
||||
var/list/emote_see = list() //Unlike speak_emote, the list of things in this variable only show by themselves with no spoken text. IE: Ian barks, Ian yaps
|
||||
|
||||
var/turns_per_move = 1
|
||||
var/turns_since_move = 0
|
||||
universal_speak = 1
|
||||
var/meat_amount = 0
|
||||
var/meat_type
|
||||
var/stop_automated_movement = 0 //Use this to temporarely stop random movement or to if you write special movement code for animals.
|
||||
var/stop_automated_movement_when_pulled = 1 //When set to 1 this stops the animal from moving when someone is pulling it.
|
||||
|
||||
//Interaction
|
||||
var/response_help = "You try to help"
|
||||
var/response_disarm = "You try to disarm"
|
||||
var/response_harm = "You try to hurt"
|
||||
var/harm_intent_damage = 3
|
||||
|
||||
//Temperature effect
|
||||
var/minbodytemp = 250
|
||||
var/maxbodytemp = 350
|
||||
var/heat_damage_per_tick = 3 //amount of damage applied if animal's body temperature is higher than maxbodytemp
|
||||
var/cold_damage_per_tick = 2 //same as heat_damage_per_tick, only if the bodytemperature it's lower than minbodytemp
|
||||
|
||||
//Atmos effect - Yes, you can make creatures that require plasma or co2 to survive. N2O is a trace gas and handled separately, hence why it isn't here. It'd be hard to add it. Hard and me don't mix (Yes, yes make all the dick jokes you want with that.) - Errorage
|
||||
var/min_oxy = 5
|
||||
var/max_oxy = 0 //Leaving something at 0 means it's off - has no maximum
|
||||
var/min_tox = 0
|
||||
var/max_tox = 1
|
||||
var/min_co2 = 0
|
||||
var/max_co2 = 5
|
||||
var/min_n2 = 0
|
||||
var/max_n2 = 0
|
||||
var/unsuitable_atoms_damage = 2 //This damage is taken when atmos doesn't fit all the requirements above
|
||||
|
||||
|
||||
//LETTING SIMPLE ANIMALS ATTACK? WHAT COULD GO WRONG. Defaults to zero so Ian can still be cuddly
|
||||
var/melee_damage_lower = 0
|
||||
var/melee_damage_upper = 0
|
||||
var/attacktext = "attacks"
|
||||
var/attack_sound = null
|
||||
var/friendly = "nuzzles" //If the mob does no damage with it's attack
|
||||
var/wall_smash = 0 //if they can smash walls
|
||||
|
||||
var/speed = 0 //LETS SEE IF I CAN SET SPEEDS FOR SIMPLE MOBS WITHOUT DESTROYING EVERYTHING. Higher speed is slower, negative speed is faster
|
||||
|
||||
/mob/living/simple_animal/New()
|
||||
..()
|
||||
verbs -= /mob/verb/observe
|
||||
|
||||
/mob/living/simple_animal/Login()
|
||||
if(src && src.client)
|
||||
src.client.screen = null
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/updatehealth()
|
||||
return
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/Life()
|
||||
|
||||
//Health
|
||||
if(stat == DEAD)
|
||||
if(health > 0)
|
||||
icon_state = icon_living
|
||||
dead_mob_list -= src
|
||||
living_mob_list += src
|
||||
stat = CONSCIOUS
|
||||
density = 1
|
||||
return 0
|
||||
|
||||
|
||||
if(health < 1)
|
||||
Die()
|
||||
|
||||
if(health > maxHealth)
|
||||
health = maxHealth
|
||||
|
||||
if(stunned)
|
||||
AdjustStunned(-1)
|
||||
if(weakened)
|
||||
AdjustWeakened(-1)
|
||||
if(paralysis)
|
||||
AdjustParalysis(-1)
|
||||
|
||||
//Movement
|
||||
if(!client && !stop_automated_movement)
|
||||
if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc.
|
||||
turns_since_move++
|
||||
if(turns_since_move >= turns_per_move)
|
||||
if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled
|
||||
Move(get_step(src,pick(cardinal)))
|
||||
turns_since_move = 0
|
||||
|
||||
//Speaking
|
||||
if(!client && speak_chance)
|
||||
if(rand(0,200) < speak_chance)
|
||||
if(speak && speak.len)
|
||||
if((emote_hear && emote_hear.len) || (emote_see && emote_see.len))
|
||||
var/length = speak.len
|
||||
if(emote_hear && emote_hear.len)
|
||||
length += emote_hear.len
|
||||
if(emote_see && emote_see.len)
|
||||
length += emote_see.len
|
||||
var/randomValue = rand(1,length)
|
||||
if(randomValue <= speak.len)
|
||||
say(pick(speak))
|
||||
else
|
||||
randomValue -= speak.len
|
||||
if(emote_see && randomValue <= emote_see.len)
|
||||
emote(pick(emote_see),1)
|
||||
else
|
||||
emote(pick(emote_hear),2)
|
||||
else
|
||||
say(pick(speak))
|
||||
else
|
||||
if(!(emote_hear && emote_hear.len) && (emote_see && emote_see.len))
|
||||
emote(pick(emote_see),1)
|
||||
if((emote_hear && emote_hear.len) && !(emote_see && emote_see.len))
|
||||
emote(pick(emote_hear),2)
|
||||
if((emote_hear && emote_hear.len) && (emote_see && emote_see.len))
|
||||
var/length = emote_hear.len + emote_see.len
|
||||
var/pick = rand(1,length)
|
||||
if(pick <= emote_see.len)
|
||||
emote(pick(emote_see),1)
|
||||
else
|
||||
emote(pick(emote_hear),2)
|
||||
|
||||
|
||||
//Atmos
|
||||
var/atmos_suitable = 1
|
||||
|
||||
var/atom/A = src.loc
|
||||
if(isturf(A))
|
||||
var/turf/T = A
|
||||
var/areatemp = T.temperature
|
||||
if( abs(areatemp - bodytemperature) > 40 )
|
||||
var/diff = areatemp - bodytemperature
|
||||
diff = diff / 5
|
||||
//world << "changed from [bodytemperature] by [diff] to [bodytemperature + diff]"
|
||||
bodytemperature += diff
|
||||
|
||||
if(istype(T,/turf/simulated))
|
||||
var/turf/simulated/ST = T
|
||||
if(ST.air)
|
||||
var/tox = ST.air.toxins
|
||||
var/oxy = ST.air.oxygen
|
||||
var/n2 = ST.air.nitrogen
|
||||
var/co2 = ST.air.carbon_dioxide
|
||||
|
||||
if(min_oxy)
|
||||
if(oxy < min_oxy)
|
||||
atmos_suitable = 0
|
||||
if(max_oxy)
|
||||
if(oxy > max_oxy)
|
||||
atmos_suitable = 0
|
||||
if(min_tox)
|
||||
if(tox < min_tox)
|
||||
atmos_suitable = 0
|
||||
if(max_tox)
|
||||
if(tox > max_tox)
|
||||
atmos_suitable = 0
|
||||
if(min_n2)
|
||||
if(n2 < min_n2)
|
||||
atmos_suitable = 0
|
||||
if(max_n2)
|
||||
if(n2 > max_n2)
|
||||
atmos_suitable = 0
|
||||
if(min_co2)
|
||||
if(co2 < min_co2)
|
||||
atmos_suitable = 0
|
||||
if(max_co2)
|
||||
if(co2 > max_co2)
|
||||
atmos_suitable = 0
|
||||
|
||||
//Atmos effect
|
||||
if(bodytemperature < minbodytemp)
|
||||
health -= cold_damage_per_tick
|
||||
else if(bodytemperature > maxbodytemp)
|
||||
health -= heat_damage_per_tick
|
||||
|
||||
if(!atmos_suitable)
|
||||
health -= unsuitable_atoms_damage
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/Bumped(AM as mob|obj)
|
||||
if(!AM) return
|
||||
|
||||
if(resting || buckled)
|
||||
return
|
||||
|
||||
if(isturf(src.loc))
|
||||
if(ismob(AM))
|
||||
var/newamloc = src.loc
|
||||
src.loc = AM:loc
|
||||
AM:loc = newamloc
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/gib()
|
||||
if(icon_gib)
|
||||
flick(icon_gib, src)
|
||||
if(meat_amount && meat_type)
|
||||
for(var/i = 0; i < meat_amount; i++)
|
||||
new meat_type(src.loc)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/say_quote(var/text)
|
||||
if(speak_emote && speak_emote.len)
|
||||
var/emote = pick(speak_emote)
|
||||
if(emote)
|
||||
return "[emote], \"[text]\""
|
||||
return "says, \"[text]\"";
|
||||
|
||||
/mob/living/simple_animal/emote(var/act)
|
||||
if(act)
|
||||
if(act == "scream") act = "makes a loud and pained whimper" //ugly hack to stop animals screaming when crushed :P
|
||||
for (var/mob/O in viewers(src, null))
|
||||
O.show_message("<B>[src]</B> [act].")
|
||||
|
||||
|
||||
/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0)
|
||||
M.emote("[M.friendly] [src]")
|
||||
else
|
||||
if(M.attack_sound)
|
||||
playsound(loc, M.attack_sound, 50, 1, 1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("\red <B>[M]</B> [M.attacktext] [src]!", 1)
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>attacked [src.name] ([src.ckey])</font>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [M.name] ([M.ckey])</font>")
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
health -= damage
|
||||
|
||||
/mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!Proj) return
|
||||
src.health -= Proj.damage
|
||||
return 0
|
||||
|
||||
/mob/living/simple_animal/attack_hand(mob/living/carbon/human/M as mob)
|
||||
..()
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if("help")
|
||||
if (health > 0)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("\blue [M] [response_help] [src]")
|
||||
|
||||
if("grab")
|
||||
if (M == src)
|
||||
return
|
||||
if (nopush)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
|
||||
|
||||
if("hurt")
|
||||
health -= harm_intent_damage
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("\red [M] [response_harm] [src]")
|
||||
|
||||
if("disarm")
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("\blue [M] [response_disarm] [src]")
|
||||
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if ("help")
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\blue [M] caresses [src] with its scythe like arm."), 1)
|
||||
if ("grab")
|
||||
if(M == src)
|
||||
return
|
||||
if (nopush)
|
||||
return
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
|
||||
|
||||
if("hurt")
|
||||
var/damage = rand(15, 30)
|
||||
visible_message("\red <B>[M] has slashed at [src]!</B>")
|
||||
src.health -= damage
|
||||
|
||||
|
||||
if("disarm")
|
||||
var/damage = rand(15, 30)
|
||||
visible_message("\red <B>[M] has slashed at [src]!</B>")
|
||||
src.health -= damage
|
||||
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/attack_larva(mob/living/carbon/alien/larva/L as mob)
|
||||
|
||||
switch(L.a_intent)
|
||||
if("help")
|
||||
visible_message("\blue [L] rubs it's head against [src]")
|
||||
|
||||
else
|
||||
|
||||
var/damage = rand(5, 10)
|
||||
visible_message("\red <B>[L] bites [src]!</B>")
|
||||
|
||||
if(stat != DEAD)
|
||||
src.health -= damage
|
||||
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
|
||||
|
||||
|
||||
/mob/living/simple_animal/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
|
||||
if(istype(O, /obj/item/stack/medical))
|
||||
if(stat != DEAD)
|
||||
var/obj/item/stack/medical/MED = O
|
||||
if(health < maxHealth)
|
||||
if(MED.amount >= 1)
|
||||
health = min(maxHealth, health + MED.heal_brute)
|
||||
MED.amount -= 1
|
||||
if(MED.amount <= 0)
|
||||
del(MED)
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if ((M.client && !( M.blinded )))
|
||||
M.show_message("\blue [user] applies the [MED] on [src]")
|
||||
else
|
||||
user << "\blue this [src] is dead, medical items won't bring it back to life."
|
||||
if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead.
|
||||
if(istype(O, /obj/item/weapon/kitchenknife) || istype(O, /obj/item/weapon/butch))
|
||||
new meat_type (get_turf(src))
|
||||
if(prob(95))
|
||||
del(src)
|
||||
return
|
||||
gib()
|
||||
else
|
||||
if(O.force)
|
||||
var/damage = O.force
|
||||
if (O.damtype == HALLOSS)
|
||||
damage = 0
|
||||
health -= damage
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if ((M.client && !( M.blinded )))
|
||||
M.show_message("\red \b [src] has been attacked with the [O] by [user]. ")
|
||||
else
|
||||
usr << "\red This weapon is ineffective, it does no damage."
|
||||
for(var/mob/M in viewers(src, null))
|
||||
if ((M.client && !( M.blinded )))
|
||||
M.show_message("\red [user] gently taps [src] with the [O]. ")
|
||||
|
||||
|
||||
/mob/living/simple_animal/movement_delay()
|
||||
var/tally = 0 //Incase I need to add stuff other than "speed" later
|
||||
|
||||
tally = speed
|
||||
|
||||
return tally+config.animal_delay
|
||||
|
||||
/mob/living/simple_animal/Stat()
|
||||
..()
|
||||
|
||||
statpanel("Status")
|
||||
stat(null, "Health: [round((health / maxHealth) * 100)]%")
|
||||
|
||||
/mob/living/simple_animal/proc/Die()
|
||||
living_mob_list -= src
|
||||
dead_mob_list += src
|
||||
icon_state = icon_dead
|
||||
stat = DEAD
|
||||
density = 0
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/ex_act(severity)
|
||||
if(!blinded)
|
||||
flick("flash", flash)
|
||||
switch (severity)
|
||||
if (1.0)
|
||||
health -= 500
|
||||
gib()
|
||||
return
|
||||
|
||||
if (2.0)
|
||||
health -= 60
|
||||
|
||||
|
||||
if(3.0)
|
||||
health -= 30
|
||||
|
||||
/mob/living/simple_animal/adjustBruteLoss(damage)
|
||||
health -= damage
|
||||
|
||||
/mob/living/simple_animal/proc/SA_attackable(target_mob)
|
||||
if (isliving(target_mob))
|
||||
var/mob/living/L = target_mob
|
||||
if(!L.stat)
|
||||
return (0)
|
||||
if (istype(target_mob,/obj/mecha))
|
||||
var/obj/mecha/M = target_mob
|
||||
if (M.occupant)
|
||||
return (0)
|
||||
return (1)
|
||||
@@ -38,6 +38,7 @@
|
||||
min_n2 = 0
|
||||
max_n2 = 0
|
||||
unsuitable_atoms_damage = 15
|
||||
wall_smash = 1
|
||||
|
||||
var/stance = SYNDICATE_STANCE_IDLE //Used to determine behavior
|
||||
var/mob/living/target_mob
|
||||
@@ -53,6 +54,10 @@
|
||||
del src
|
||||
return
|
||||
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
var/obj/structure/obstacle = locate(/obj/structure, get_step(src, dir))
|
||||
if(istype(obstacle, /obj/structure/window) || istype(obstacle, /obj/structure/closet) || istype(obstacle, /obj/structure/table) || istype(obstacle, /obj/structure/grille))
|
||||
obstacle.attack_animal(src)
|
||||
|
||||
if(health < 1)
|
||||
Die()
|
||||
@@ -71,33 +76,39 @@
|
||||
if(!stat)
|
||||
switch(stance)
|
||||
if(SYNDICATE_STANCE_IDLE)
|
||||
var/obj/mecha/M = null
|
||||
var/mob/living/L = null
|
||||
|
||||
stop_automated_movement = 0
|
||||
for(L in viewers(7,src))
|
||||
if(isSyndicate(L)) continue
|
||||
if(!L.stat)
|
||||
stance = SYNDICATE_STANCE_ATTACK
|
||||
target_mob = L
|
||||
break
|
||||
for(M in view(7,src))
|
||||
if (M.occupant)
|
||||
stance = SYNDICATE_STANCE_ATTACK
|
||||
target_mob = M
|
||||
break
|
||||
|
||||
for(var/atom/A in view(7,src))
|
||||
if(isSyndicate(A))
|
||||
continue
|
||||
|
||||
if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
if(!L.stat)
|
||||
stance = SYNDICATE_STANCE_ATTACK
|
||||
target_mob = L
|
||||
break
|
||||
|
||||
if(istype(A, /obj/mecha))
|
||||
var/obj/mecha/M = A
|
||||
if (M.occupant)
|
||||
stance = SYNDICATE_STANCE_ATTACK
|
||||
target_mob = M
|
||||
break
|
||||
|
||||
if(SYNDICATE_STANCE_ATTACK) //This one should only be active for one tick
|
||||
stop_automated_movement = 1
|
||||
if(!target_mob || SA_attackable(target_mob))
|
||||
stance = SYNDICATE_STANCE_IDLE
|
||||
if(target_mob in SA_search(target_mob))
|
||||
if(target_mob in view(7, src))
|
||||
if(ranged)
|
||||
if(get_dist(src, target_mob) <= 6)
|
||||
OpenFire(target_mob)
|
||||
else
|
||||
walk_to(src, target_mob, 1, 3)
|
||||
walk_to(src, target_mob, 1, 2)
|
||||
else
|
||||
walk_to(src, target_mob, 1, 3)
|
||||
walk_to(src, target_mob, 1, 2)
|
||||
stance = SYNDICATE_STANCE_ATTACKING
|
||||
|
||||
if(SYNDICATE_STANCE_ATTACKING)
|
||||
@@ -106,7 +117,7 @@
|
||||
stance = SYNDICATE_STANCE_IDLE
|
||||
target_mob = null
|
||||
return
|
||||
if(!(target_mob in SA_search(target_mob)))
|
||||
if(!(target_mob in view(7, src)))
|
||||
stance = SYNDICATE_STANCE_IDLE
|
||||
target_mob = null
|
||||
return
|
||||
@@ -172,6 +183,7 @@
|
||||
weapon1 = /obj/item/weapon/melee/energy/sword/red
|
||||
weapon2 = /obj/item/weapon/shield/energy
|
||||
attacktext = "slashes"
|
||||
nopush = 1
|
||||
|
||||
/mob/living/simple_animal/syndicate/melee/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(O.force)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/mob/living/simple_animal/corgi/regenerate_icons()
|
||||
overlays = list()
|
||||
|
||||
if(inventory_head)
|
||||
var/head_icon_state = inventory_head.icon_state
|
||||
if(health <= 0)
|
||||
head_icon_state += "2"
|
||||
|
||||
var/icon/head_icon = icon('icons/mob/corgi_head.dmi',head_icon_state)
|
||||
if(head_icon)
|
||||
overlays += head_icon
|
||||
|
||||
if(inventory_back)
|
||||
var/back_icon_state = inventory_back.icon_state
|
||||
if(health <= 0)
|
||||
back_icon_state += "2"
|
||||
|
||||
var/icon/back_icon = icon('icons/mob/corgi_back.dmi',back_icon_state)
|
||||
if(back_icon)
|
||||
overlays += back_icon
|
||||
return
|
||||
@@ -66,12 +66,12 @@
|
||||
return 0
|
||||
|
||||
/proc/isbear(A)
|
||||
if(istype(A, /mob/living/simple_animal/bear))
|
||||
if(istype(A, /mob/living/simple_animal/hostile/bear))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iscarp(A)
|
||||
if(istype(A, /mob/living/simple_animal/carp))
|
||||
if(istype(A, /mob/living/simple_animal/hostile/carp))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
@@ -335,9 +335,6 @@
|
||||
if(!MP)
|
||||
return 0 //Sanity, this should never happen.
|
||||
|
||||
if(ispath(MP, /mob/living/simple_animal/parrot))
|
||||
return 0 //Parrots are unfinished, they have no sprite, movement, ect...(Working on this - Nodrak)
|
||||
|
||||
if(ispath(MP, /mob/living/simple_animal/space_worm))
|
||||
return 0 //Unfinished. Very buggy, they seem to just spawn additional space worms everywhere and eating your own tail results in new worms spawning.
|
||||
|
||||
@@ -360,7 +357,7 @@
|
||||
return 1
|
||||
if(ispath(MP, /mob/living/simple_animal/crab))
|
||||
return 1
|
||||
if(ispath(MP, /mob/living/simple_animal/carp))
|
||||
if(ispath(MP, /mob/living/simple_animal/hostile/carp))
|
||||
return 1
|
||||
if(ispath(MP, /mob/living/simple_animal/mushroom))
|
||||
return 1
|
||||
@@ -370,8 +367,10 @@
|
||||
return 1
|
||||
if(ispath(MP, /mob/living/simple_animal/mouse))
|
||||
return 1 //It is impossible to pull up the player panel for mice (Fixed! - Nodrak)
|
||||
if(ispath(MP, /mob/living/simple_animal/bear))
|
||||
if(ispath(MP, /mob/living/simple_animal/hostile/bear))
|
||||
return 1 //Bears will auto-attack mobs, even if they're player controlled (Fixed! - Nodrak)
|
||||
if(ispath(MP, /mob/living/simple_animal/parrot))
|
||||
return 1 //Parrots are no longer unfinished! -Nodrak
|
||||
|
||||
//Not in here? Must be untested!
|
||||
return 0
|
||||
|
||||
@@ -729,7 +729,7 @@
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/soybeans = list("soymilk" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato = list("ketchup" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/corn = list("cornoil" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/wheat = list("flour" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/wheat = list("flour" = -5),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cherries = list("cherryjelly" = 0),
|
||||
|
||||
|
||||
@@ -994,7 +994,7 @@
|
||||
spawn(60)
|
||||
inuse = 0
|
||||
interact(usr)
|
||||
//Snacks
|
||||
//Snacks and Plants
|
||||
for (var/obj/item/weapon/reagent_containers/food/snacks/O in holdingitems)
|
||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
@@ -1007,10 +1007,15 @@
|
||||
|
||||
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
|
||||
var/amount = allowed[r_id]
|
||||
if(amount == 0)
|
||||
if (O.reagents != null && O.reagents.has_reagent("nutriment"))
|
||||
beaker.reagents.add_reagent(r_id, min(O.reagents.get_reagent_amount("nutriment"), space))
|
||||
O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
|
||||
if(amount <= 0)
|
||||
if(amount == 0)
|
||||
if (O.reagents != null && O.reagents.has_reagent("nutriment"))
|
||||
beaker.reagents.add_reagent(r_id, min(O.reagents.get_reagent_amount("nutriment"), space))
|
||||
O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
|
||||
else
|
||||
if (O.reagents != null && O.reagents.has_reagent("nutriment"))
|
||||
beaker.reagents.add_reagent(r_id, min(round(O.reagents.get_reagent_amount("nutriment")*abs(amount)), space))
|
||||
O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
|
||||
|
||||
else
|
||||
O.reagents.trans_id_to(beaker, r_id, min(amount, space))
|
||||
|
||||
Reference in New Issue
Block a user