mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merges AI Branch into Master
This commit is contained in:
18
code/modules/mob/_modifiers/auras.dm
Normal file
18
code/modules/mob/_modifiers/auras.dm
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
'Aura' modifiers are semi-permanent, in that they do not have a set duration, but will expire if out of range of the 'source' of the aura.
|
||||
Note: The source is defined as an argument in New(), and if not specified, it is assumed the holder is the source,
|
||||
making it not expire ever, which is likely not what you want.
|
||||
*/
|
||||
|
||||
/datum/modifier/aura
|
||||
var/aura_max_distance = 5 // If more than this many tiles away from the source, the modifier expires next tick.
|
||||
|
||||
/datum/modifier/aura/check_if_valid()
|
||||
if(!origin)
|
||||
expire()
|
||||
var/atom/A = origin.resolve()
|
||||
if(istype(A)) // Make sure we're not null.
|
||||
if(get_dist(holder, A) > aura_max_distance)
|
||||
expire()
|
||||
else
|
||||
expire() // Source got deleted or something.
|
||||
@@ -149,6 +149,13 @@
|
||||
/mob/living/proc/remove_specific_modifier(var/datum/modifier/M, var/silent = FALSE)
|
||||
M.expire(silent)
|
||||
|
||||
// Removes one modifier of a type
|
||||
/mob/living/proc/remove_a_modifier_of_type(var/modifier_type, var/silent = FALSE)
|
||||
for(var/datum/modifier/M in modifiers)
|
||||
if(ispath(M.type, modifier_type))
|
||||
M.expire(silent)
|
||||
break
|
||||
|
||||
// Removes all modifiers of a type
|
||||
/mob/living/proc/remove_modifiers_of_type(var/modifier_type, var/silent = FALSE)
|
||||
for(var/datum/modifier/M in modifiers)
|
||||
|
||||
@@ -29,7 +29,7 @@ Berserk is a somewhat rare modifier to obtain freely (and for good reason), howe
|
||||
- Red Slimes will berserk if they go rabid.
|
||||
- Red slime core reactions will berserk slimes that can see the user in addition to making them go rabid.
|
||||
- Red slime core reactions will berserk prometheans that can see the user.
|
||||
- Bears will berserk when losing a fight.
|
||||
- Saviks will berserk when losing a fight.
|
||||
- Changelings can evolve a 2 point ability to use a changeling-specific variant of Berserk, that replaces the text with a 'we' variant.
|
||||
Recursive Enhancement allows the changeling to instead used an improved variant that features less exhaustion time and less nutrition drain.
|
||||
- Xenoarch artifacts may have forced berserking as one of their effects. This is especially fun if an artifact that makes hostile mobs is nearby.
|
||||
@@ -180,3 +180,70 @@ the artifact triggers the rage.
|
||||
accuracy = -75 // Aiming requires focus.
|
||||
accuracy_dispersion = 3 // Ditto.
|
||||
evasion = -45 // Too angry to dodge.
|
||||
|
||||
|
||||
|
||||
|
||||
// Ignition, but confined to the modifier system.
|
||||
// This makes it more predictable and thus, easier to balance.
|
||||
/datum/modifier/fire
|
||||
name = "on fire"
|
||||
desc = "You are on fire! You will be harmed until the fire goes out or you extinguish it with water."
|
||||
mob_overlay_state = "on_fire"
|
||||
|
||||
on_created_text = "<span class='danger'>You combust into flames!</span>"
|
||||
on_expired_text = "<span class='warning'>The fire starts to fade.</span>"
|
||||
stacks = MODIFIER_STACK_ALLOWED // Multiple instances will hurt a lot.
|
||||
var/damage_per_tick = 5
|
||||
|
||||
/datum/modifier/fire/tick()
|
||||
holder.inflict_heat_damage(damage_per_tick)
|
||||
|
||||
|
||||
// Applied when near something very cold.
|
||||
// Reduces mobility, attack speed.
|
||||
/datum/modifier/chilled
|
||||
name = "chilled"
|
||||
desc = "You feel yourself freezing up. Its hard to move."
|
||||
mob_overlay_state = "chilled"
|
||||
|
||||
on_created_text = "<span class='danger'>You feel like you're going to freeze! It's hard to move.</span>"
|
||||
on_expired_text = "<span class='warning'>You feel somewhat warmer and more mobile now.</span>"
|
||||
stacks = MODIFIER_STACK_EXTEND
|
||||
|
||||
slowdown = 2
|
||||
evasion = -40
|
||||
attack_speed_percent = 1.4
|
||||
disable_duration_percent = 1.2
|
||||
|
||||
|
||||
// Similar to being on fire, except poison tends to be more long term.
|
||||
// Antitoxins will remove stacks over time.
|
||||
// Synthetics can't receive this.
|
||||
/datum/modifier/poisoned
|
||||
name = "poisoned"
|
||||
desc = "You have poison inside of you. It will cause harm over a long span of time if not cured."
|
||||
mob_overlay_state = "poisoned"
|
||||
|
||||
on_created_text = "<span class='warning'>You feel sick...</span>"
|
||||
on_expired_text = "<span class='notice'>You feel a bit better.</span>"
|
||||
stacks = MODIFIER_STACK_ALLOWED // Multiple instances will hurt a lot.
|
||||
var/damage_per_tick = 1
|
||||
|
||||
/datum/modifier/poisoned/weak
|
||||
damage_per_tick = 0.5
|
||||
|
||||
/datum/modifier/poisoned/strong
|
||||
damage_per_tick = 2
|
||||
|
||||
/datum/modifier/poisoned/tick()
|
||||
if(holder.stat == DEAD)
|
||||
expire(silent = TRUE)
|
||||
holder.inflict_poison_damage(damage_per_tick)
|
||||
|
||||
/datum/modifier/poisoned/can_apply(mob/living/L)
|
||||
if(L.isSynthetic())
|
||||
return FALSE
|
||||
if(L.get_poison_protection() >= 1)
|
||||
return FALSE
|
||||
return TRUE
|
||||
@@ -207,8 +207,8 @@
|
||||
if(istype(thing, /obj/structure/snowman/spider)) //Snow spiders are also spooky so people can be assholes with those too.
|
||||
fear_amount += 1
|
||||
|
||||
if(istype(thing, /mob/living/simple_animal/hostile/giant_spider)) // Actual giant spiders are the scariest of them all.
|
||||
var/mob/living/simple_animal/hostile/giant_spider/S = thing
|
||||
if(istype(thing, /mob/living/simple_mob/animal/giant_spider)) // Actual giant spiders are the scariest of them all.
|
||||
var/mob/living/simple_mob/animal/giant_spider/S = thing
|
||||
if(S.stat == DEAD) // Dead giant spiders are less scary than alive ones.
|
||||
fear_amount += 4
|
||||
else
|
||||
@@ -425,14 +425,18 @@
|
||||
if(istype(thing, /obj/item/clothing/head/collectable/slime)) // Some hats are spooky so people can be assholes with them.
|
||||
fear_amount += 1
|
||||
|
||||
if(istype(thing, /mob/living/simple_animal/slime)) // An actual predatory specimen!
|
||||
var/mob/living/simple_animal/slime/S = thing
|
||||
if(istype(thing, /mob/living/simple_mob/slime)) // An actual predatory specimen!
|
||||
var/mob/living/simple_mob/slime/S = thing
|
||||
if(S.stat == DEAD) // Dead slimes are somewhat less spook.
|
||||
fear_amount += 4
|
||||
if(S.is_adult == TRUE) //big boy
|
||||
fear_amount += 8
|
||||
if(istype(S, /mob/living/simple_mob/slime/xenobio))
|
||||
var/mob/living/simple_mob/slime/xenobio/X = S
|
||||
if(X.is_adult == TRUE) //big boy
|
||||
fear_amount += 8
|
||||
else
|
||||
fear_amount += 6
|
||||
else
|
||||
fear_amount += 6
|
||||
fear_amount += 10 // It's huge and feral.
|
||||
|
||||
if(istype(thing, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/S = thing
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
/datum/modifier/repair_aura/tick()
|
||||
spawn()
|
||||
for(var/mob/living/simple_animal/construct/T in view(4,holder))
|
||||
for(var/mob/living/simple_mob/construct/T in view(4,holder))
|
||||
T.adjustBruteLoss(rand(-10,-15))
|
||||
T.adjustFireLoss(rand(-10,-15))
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
spawn()
|
||||
if(isliving(holder))
|
||||
var/mob/living/L = holder
|
||||
if(istype(L, /mob/living/simple_animal/construct))
|
||||
if(istype(L, /mob/living/simple_mob/construct))
|
||||
L.adjustBruteLoss(rand(-5,-10))
|
||||
L.adjustFireLoss(rand(-5,-10))
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user