Merge pull request #9005 from MistakeNot4892/drakemap

Adds xenofauna lab
This commit is contained in:
Atermonera
2023-03-08 18:55:33 -08:00
committed by GitHub
19 changed files with 1199 additions and 273 deletions
@@ -1,10 +1,7 @@
// Hit by a projectile.
/mob/living/simple_mob/bullet_act(var/obj/item/projectile/P)
//Projectiles with bonus SA damage
if(!P.nodamage)
// if(!P.SA_vulnerability || P.SA_vulnerability == intelligence_level)
if(P.SA_vulnerability & mob_class)
P.damage += P.SA_bonus_damage
P.damage += P.apply_SA_vulnerability(src)
. = ..()
+25 -20
View File
@@ -22,6 +22,7 @@
//Should we be dead?
/mob/living/simple_mob/updatehealth()
var/lasthealth = health
health = getMaxHealth() - getFireLoss() - getBruteLoss() - getToxLoss() - getOxyLoss() - getCloneLoss()
//Alive, becoming dead
@@ -33,26 +34,30 @@
health = getMaxHealth()
//Update our hud if we have one
if(healths)
if(stat != DEAD)
var/heal_per = (health / getMaxHealth()) * 100
switch(heal_per)
if(100 to INFINITY)
healths.icon_state = "health0"
if(80 to 100)
healths.icon_state = "health1"
if(60 to 80)
healths.icon_state = "health2"
if(40 to 60)
healths.icon_state = "health3"
if(20 to 40)
healths.icon_state = "health4"
if(0 to 20)
healths.icon_state = "health5"
else
healths.icon_state = "health6"
else
healths.icon_state = "health7"
if(lasthealth != health)
if(lasthealth > health && sleeping) // Damage wakes us up.
tranq_countdown = 0
SetSleeping(0)
if(healths)
if(stat != DEAD)
var/heal_per = (health / getMaxHealth()) * 100
switch(heal_per)
if(100 to INFINITY)
healths.icon_state = "health0"
if(80 to 100)
healths.icon_state = "health1"
if(60 to 80)
healths.icon_state = "health2"
if(40 to 60)
healths.icon_state = "health3"
if(20 to 40)
healths.icon_state = "health4"
if(0 to 20)
healths.icon_state = "health5"
else
healths.icon_state = "health6"
else
healths.icon_state = "health7"
//Updates the nutrition while we're here
var/food_per = (nutrition / max_nutrition) * 100
@@ -163,6 +163,11 @@
// Used for if the mob can drop limbs. Overrides the icon cache key, so it doesn't keep remaking the icon needlessly.
var/limb_icon_key
/// If above zero, decrement in Life(); on zero, put the mob to sleep for thirty seconds.
var/tranq_countdown = 0
/// A temporary storage value for the duration of any tranquilizer effect.
var/tranq_duration
/mob/living/simple_mob/Initialize()
verbs -= /mob/verb/observe
health = maxHealth
@@ -288,3 +293,17 @@
/decl/mob_organ_names
var/list/hit_zones = list("body") //When in doubt, it's probably got a body.
/mob/living/simple_mob/handle_sleeping()
if(sleeping || stat != CONSCIOUS)
tranq_countdown = null
tranq_duration = null
else if(tranq_countdown > 0)
tranq_countdown--
if(tranq_countdown <= 0)
if(client)
to_chat(src, SPAN_DANGER("You fall asleep!"))
SetSleeping(max(1, round(tranq_duration / SSmobs.wait)))
else if(prob(5) && client)
to_chat(src, SPAN_WARNING("You feel [pick("dizzy", "woozy", "sleepy")]..."))
return ..()
+25 -2
View File
@@ -1,5 +1,4 @@
// Phase weapons go here
/obj/item/gun/energy/phasegun
name = "phase carbine"
desc = "The RayZar EW26 Artemis is a downsized energy weapon, specifically designed for use against wildlife."
@@ -12,6 +11,30 @@
projectile_type = /obj/item/projectile/energy/phase
one_handed_penalty = 15
/obj/item/gun/energy/phasegun/tranq_rifle
name = "tranquilizer rifle"
desc = "A niche RayZar product designed for nonlethal animal control. A specialized emitter disrupts the nervous system of the target, eventually inducing sleep. Only rated for use on wildlife."
icon_state = "phaserifle"
item_state = "phaserifle"
wielded_item_state = "phaserifle-wielded"
w_class = ITEMSIZE_LARGE
slot_flags = SLOT_BACK
charge_cost = 140
projectile_type = /obj/item/projectile/energy/phase/tranq
accuracy = 15
one_handed_penalty = 30
/obj/item/gun/energy/phasegun/tranq_pistol
name = "tranquilizer pistol"
desc = "A niche RayZar product designed for nonlethal animal control. A specialized emitter disrupts the nervous system of the target, eventually inducing sleep. Only rated for use on wildlife."
icon_state = "phase"
item_state = "taser"
w_class = ITEMSIZE_NORMAL
slot_flags = SLOT_BELT|SLOT_HOLSTER
charge_cost = 200
projectile_type = /obj/item/projectile/energy/phase/tranq/weak
one_handed_penalty = 0
/obj/item/gun/energy/phasegun/mounted
self_recharge = 1
use_external_power = 1
@@ -65,4 +88,4 @@
charge_cost = 100
projectile_type = /obj/item/projectile/energy/phase/heavy/cannon
accuracy = 15
one_handed_penalty = 65
one_handed_penalty = 65
+6
View File
@@ -820,3 +820,9 @@
if(silenced)
volume = 5
playsound(A, hitsound_wall, volume, 1, -1)
/obj/item/projectile/proc/apply_SA_vulnerability(var/mob/living/simple_mob/victim)
if(!nodamage && SA_bonus_damage && istype(victim) && (SA_vulnerability & victim.mob_class))
return SA_bonus_damage
return 0
+30 -1
View File
@@ -292,4 +292,33 @@
range = 10
damage = 15
SA_bonus_damage = 60 // 75 total on animals
hud_state = "laser_heat"
hud_state = "laser_heat"
/obj/item/projectile/energy/phase/tranq
name = "tranquilizer wave"
range = 10
damage = 0
nodamage = TRUE
SA_bonus_damage = 0
hud_state = "laser_heat"
var/tranq_duration = 30 SECONDS
var/tranq_delay = 10 SECONDS
var/tranq_delay_modifier = 0.7
/obj/item/projectile/energy/phase/tranq/weak
range = 6
tranq_duration = 20 SECONDS
tranq_delay = 15 SECONDS
tranq_delay_modifier = 0.9
// Being hit with a tranq shot either shaves a percentage off the remaining delay, or starts the timer.
/obj/item/projectile/energy/phase/tranq/apply_SA_vulnerability(var/mob/living/simple_mob/victim)
..()
if(!istype(victim) || victim.stat != CONSCIOUS || !(SA_vulnerability & victim.mob_class))
return
if(victim.tranq_countdown <= 0)
victim.tranq_countdown = tranq_duration / SSmobs.wait
else
victim.tranq_countdown *= tranq_delay_modifier
victim.tranq_duration = (victim.tranq_duration > 0) ? min(tranq_duration, victim.tranq_duration) : tranq_duration
victim.tranq_countdown = max(1, round(victim.tranq_countdown))