Skip to content

Commit

Permalink
Merge branch 'master220' into Babylonian-Fever
Browse files Browse the repository at this point in the history
  • Loading branch information
Daeberdir authored Oct 10, 2024
2 parents b83d00d + bbf91d3 commit 0c8fb00
Show file tree
Hide file tree
Showing 35 changed files with 377 additions and 196 deletions.
13 changes: 13 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -442,3 +442,16 @@
#define SHOCK_KNOCKDOWN (1<<7)
/// For babylon fever,
#define DISEASE_LIVING_LANGUAGE_PROCESSED (1<<0)


/// Vomit defines
#define VOMIT_NUTRITION_LOSS 10
#define VOMIT_STUN_TIME (8 SECONDS)
#define VOMIT_DISTANCE 1
#define VOMIT_SAFE_NUTRITION 90
/// Vomit modes
#define VOMIT_BLOOD (1<<0)

/// When reached - we'll apply status effect which will force carbon to vomit
#define TOX_VOMIT_THRESHOLD_REACHED(mob, toxloss) (mob.getToxLoss() >= toxloss)
#define TOX_VOMIT_REQUIRED_TOXLOSS 45
14 changes: 14 additions & 0 deletions code/__DEFINES/spells.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/// Spell target defines
#define SPELL_TARGET_CLOSEST 1
#define SPELL_TARGET_RANDOM 2
/// Spell target selection
#define SPELL_SELECTION_RANGE "range"
#define SPELL_SELECTION_VIEW "view"
/// Smoke spell defines
#define SMOKE_NONE 0
#define SMOKE_HARMLESS 1
#define SMOKE_COUGHING 2
#define SMOKE_SLEEPING 3
/// Recharge spell defines
#define RECHARGE_SUCCESSFUL (1<<0)
#define RECHARGE_BURNOUT (1<<1)
2 changes: 2 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@

#define STATUS_EFFECT_DASH /datum/status_effect/dash // Grants the ability to dash, expiring after a few seconds

#define STATUS_EFFECT_VOMIT /datum/status_effect/tox_vomit // When carbon got enough tox damage - he will vomit.

//#define STATUS_EFFECT_NECROPOLIS_CURSE /datum/status_effect/necropolis_curse
//#define CURSE_BLINDING 1 //makes the edges of the target's screen obscured
//#define CURSE_SPAWNING 2 //spawns creatures that attack the target only
Expand Down
12 changes: 6 additions & 6 deletions code/datums/components/eatable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/// integrity spend after bite
var/integrity_bite // integrity spend after bite
/// How much nutrition add
var/nutritional_value
var/nutritional_value
/// Grab if help_intent was used
var/is_only_grab_intent
/// If true - your item can be eaten without special diet check.
Expand All @@ -29,7 +29,7 @@
)
if(!isitem(parent))
return COMPONENT_INCOMPATIBLE

src.current_bites = current_bites
src.material_type = material_type
src.max_bites = max_bites
Expand All @@ -38,7 +38,7 @@
src.is_only_grab_intent = is_only_grab_intent
src.is_always_eatable = is_always_eatable
src.stack_use = stack_use

/datum/component/eatable/RegisterWithParent()
RegisterSignal(parent, COMSIG_ITEM_PRE_ATTACKBY, PROC_REF(pre_try_eat_item))
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, PROC_REF(on_examine))
Expand All @@ -53,7 +53,7 @@

if(!istype(human))
return

if(material_type & human.dna.species.special_diet)
examine_list += "Вкуснятина! [is_only_grab_intent ? "\nНужно аккуратно есть." : ""]"

Expand Down Expand Up @@ -134,7 +134,7 @@

to_chat(target, span_notice("[chat_message_to_target]"))
add_attack_logs(user, item, "Force Fed [target], item [item]")

if(!isstack(item))
to_chat(user, span_notice("[chat_message_to_user]"))

Expand Down Expand Up @@ -170,7 +170,7 @@
item.visible_message(span_warning("[user] пытается накормить [target], запихивая в рот [item.name]."))
if(!do_after(user, target, 2 SECONDS, NONE))
return FALSE

return TRUE

/datum/component/eatable/proc/get_colour()
Expand Down
4 changes: 2 additions & 2 deletions code/datums/diseases/viruses/advance/symptoms/vomit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Bonus
severity = 5

/datum/symptom/vomit/blood/Vomit(mob/living/carbon/M)
M.vomit(0, 1)
M.vomit(0, VOMIT_BLOOD)


/*
Expand Down Expand Up @@ -106,4 +106,4 @@ Bonus
level = 4

/datum/symptom/vomit/projectile/Vomit(mob/living/carbon/M)
M.vomit(6,0,8 SECONDS,5,1)
M.vomit(6, distance = 5)
12 changes: 0 additions & 12 deletions code/datums/spell.dm
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#define SPELL_TARGET_CLOSEST 1
#define SPELL_TARGET_RANDOM 2

#define SPELL_SELECTION_RANGE "range"
#define SPELL_SELECTION_VIEW "view"

#define SMOKE_NONE 0
#define SMOKE_HARMLESS 1
#define SMOKE_COUGHING 2
#define SMOKE_SLEEPING 3


/obj/effect/proc_holder
var/active = FALSE //Used by toggle based abilities.
var/ranged_mousepointer
Expand Down
4 changes: 2 additions & 2 deletions code/datums/spells/chaplain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
school = "transmutation"
base_cooldown = 6 SECONDS
clothes_req = FALSE
selection_activated_message = "<span class='notice'>You prepare a blessing. Click on a target to start blessing.</span>"
selection_deactivated_message = "<span class='notice'>The crew will be blessed another time.</span>"
selection_activated_message = span_notice("You prepare a blessing. Click on a target to start blessing.")
selection_deactivated_message = span_notice("The crew will be blessed another time.")
cooldown_min = 2 SECONDS
action_icon_state = "shield"
need_active_overlay = TRUE
Expand Down
107 changes: 21 additions & 86 deletions code/datums/spells/charge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,96 +16,31 @@


/obj/effect/proc_holder/spell/charge/cast(list/targets, mob/user = usr)
for(var/mob/living/L in targets)
var/list/hand_items = list(L.get_active_hand(),L.get_inactive_hand())
var/charged_item = null
var/burnt_out = FALSE
var/charge_result = NONE
var/atom/charge_target_name

if(L.pulling && (isliving(L.pulling)))
var/mob/living/M = L.pulling
if(LAZYLEN(M.mob_spell_list) || (M.mind && LAZYLEN(M.mind.spell_list)))
for(var/obj/effect/proc_holder/spell/spell as anything in M.mob_spell_list)
spell.cooldown_handler.revert_cast()
if(M.mind)
for(var/obj/effect/proc_holder/spell/spell as anything in M.mind.spell_list)
spell.cooldown_handler.revert_cast()
to_chat(M, "<span class='notice'>You feel raw magical energy flowing through you, it feels good!</span>")
else
to_chat(M, "<span class='notice'>You feel very strange for a moment, but then it passes.</span>")
burnt_out = TRUE
charged_item = M
break
for(var/obj/item in hand_items)
if(istype(item, /obj/item/spellbook))
if(istype(item, /obj/item/spellbook/oneuse))
var/obj/item/spellbook/oneuse/I = item
if(prob(80))
L.visible_message("<span class='warning'>[I] catches fire!</span>")
qdel(I)
else
I.used = FALSE
charged_item = I
break
else
to_chat(L, "<span class='caution'>Glowing red letters appear on the front cover...</span>")
to_chat(L, "<span class='warning'>[pick("NICE TRY BUT NO!","CLEVER BUT NOT CLEVER ENOUGH!", "SUCH FLAGRANT CHEESING IS WHY WE ACCEPTED YOUR APPLICATION!", "CUTE!", "YOU DIDN'T THINK IT'D BE THAT EASY, DID YOU?")]</span>")
burnt_out = TRUE
var/mob/living/living = targets[1]

else if(istype(item, /obj/item/book/granter))
var/obj/item/book/granter/I = item
if(prob(80))
L.visible_message("<span class='warning'>[I] catches fire!</span>")
qdel(I)
else
I.uses += 1
charged_item = I
break
if(living.pulling)
charge_target_name = living.pulling.name
charge_result = living.pulling.magic_charge_act(living)

else if(istype(item, /obj/item/gun/magic))
var/obj/item/gun/magic/I = item
if(prob(80) && !I.can_charge)
I.max_charges--
if(I.max_charges <= 0)
I.max_charges = 0
burnt_out = TRUE
I.charges = I.max_charges
if(istype(item,/obj/item/gun/magic/wand) && I.max_charges != 0)
var/obj/item/gun/magic/W = item
W.icon_state = initial(W.icon_state)
charged_item = I
break
if(!(charge_result & RECHARGE_SUCCESSFUL))
var/list/hand_items = list(living.get_active_hand(), living.get_inactive_hand())

else if(istype(item, /obj/item/stock_parts/cell/))
var/obj/item/stock_parts/cell/C = item
if(!C.self_recharge)
if(prob(80))
C.maxcharge -= 200
if(C.maxcharge <= 1) //Div by 0 protection
C.maxcharge = 1
burnt_out = TRUE
C.charge = C.maxcharge
charged_item = C
for(var/obj/item in hand_items)
charge_target_name = item.name
charge_result = item.magic_charge_act(living)

if(charge_result & RECHARGE_SUCCESSFUL)
break

else if(item.contents)
var/obj/I = null
for(I in item.contents)
if(istype(I, /obj/item/stock_parts/cell/))
var/obj/item/stock_parts/cell/C = I
if(!C.self_recharge)
if(prob(80))
C.maxcharge -= 200
if(C.maxcharge <= 1) //Div by 0 protection
C.maxcharge = 1
burnt_out = TRUE
C.charge = C.maxcharge
item.update_icon()
charged_item = item
break
if(!charged_item)
to_chat(L, "<span class='notice'>You feel magical power surging to your hands, but the feeling rapidly fades...</span>")
else if(burnt_out)
to_chat(L, "<span class='caution'>[charged_item] doesn't seem to be reacting to the spell...</span>")
else
to_chat(L, "<span class='notice'>[charged_item] suddenly feels very warm!</span>")
if(!(charge_result & RECHARGE_SUCCESSFUL))
to_chat(user, span_notice("You feel magical power surging to your hands, but the feeling rapidly fades..."))
return

if(charge_result & RECHARGE_BURNOUT)
to_chat(user, span_caution("[charge_target_name] is reacting poorly to the spell!"))
return

to_chat(user, span_notice("[charge_target_name] suddenly feels very warm!"))
8 changes: 4 additions & 4 deletions code/datums/spells/charge_up.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
var/energy_perc = get_energy_charge() / max_charge_time
if(energy_perc < 0.5)
cooldown_handler.start_recharge((1 - energy_perc) * cooldown_handler.recharge_duration) // Shorten the cooldown based on how long it was charged for.
to_chat(user, "<span class='notice'>[stop_charging_text]</span>")
to_chat(user, span_notice("[stop_charging_text]"))
Reset(user)
return TRUE
else
to_chat(user, "<span class='danger'>[stop_charging_fail_text]</span>")
to_chat(user, span_danger("[stop_charging_fail_text]"))
return FALSE


Expand All @@ -54,7 +54,7 @@


/obj/effect/proc_holder/spell/charge_up/proc/StartChargeup(mob/user)
to_chat(user, "<span class='notice'>[start_charging_text]</span>")
to_chat(user, span_notice("[start_charging_text]"))
user.add_overlay(charge_up_overlay)
playsound(user, charge_sound, 50, FALSE, channel = charge_sound.channel)
start_time = world.time
Expand All @@ -80,7 +80,7 @@


/obj/effect/proc_holder/spell/charge_up/proc/Discharge(mob/user)
to_chat(user, "<span class='danger'>You lose control over the spell!</span>")
to_chat(user, span_danger("You lose control over the spell!"))
Reset(user)
spend_spell_cost(user)
cooldown_handler.start_recharge()
Expand Down
32 changes: 31 additions & 1 deletion code/datums/status_effects/debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@
if(prob(pukeprob))
carbon.AdjustConfused(9 SECONDS)
carbon.AdjustStuttering(3 SECONDS)
carbon.vomit(15, FALSE, 8 SECONDS, 0, FALSE)
carbon.vomit(15, message = FALSE)
carbon.Dizzy(15 SECONDS)
if(strength >= DISGUST_LEVEL_DISGUSTED)
if(prob(25))
Expand Down Expand Up @@ -1227,3 +1227,33 @@
if(new_filter)
animate(get_filter("ray"), offset = 10, time = 10 SECONDS, loop = -1)
animate(offset = 0, time = 10 SECONDS)

/datum/status_effect/tox_vomit
id = "vomitting_from_toxins"
alert_type = null
processing_speed = STATUS_EFFECT_NORMAL_PROCESS
tick_interval = 2 SECONDS
var/puke_counter = 0

/datum/status_effect/tox_vomit/on_apply()
if(!iscarbon(owner))
return FALSE

return TRUE

/datum/status_effect/tox_vomit/tick(seconds_between_ticks)
if(owner.stat == DEAD || !TOX_VOMIT_THRESHOLD_REACHED(owner, TOX_VOMIT_REQUIRED_TOXLOSS) || HAS_TRAIT(owner, TRAIT_GODMODE))
qdel(src)
return

puke_counter++
if(puke_counter < 25)
return

var/mob/living/carbon/carbon = owner
puke_counter = initial(puke_counter)

if(!carbon.vomit())
return

carbon.adjustToxLoss(-3)
10 changes: 10 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,16 @@
return RCD_NO_ACT


/atom/proc/magic_charge_act(mob/user)
. = NONE

if(!contents)
return

for(var/obj/item/stock_parts/cell/cell in contents)
. |= cell.magic_charge_act(user)


/atom/proc/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
if(density && !AM.has_gravity()) //thrown stuff bounces off dense stuff in no grav, unless the thrown stuff ends up inside what it hit(embedding, bola, etc...).
addtimer(CALLBACK(src, PROC_REF(hitby_react), AM), 2)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/shadowling/shadowling_abilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@

var/mob/living/carbon/human/target = targets[1]

target.vomit(lost_nutrition = 0, blood = TRUE, stun = 8 SECONDS, distance = 1, message = FALSE)
target.vomit(0, VOMIT_BLOOD, distance = 2, message = FALSE)
playsound(user.loc, 'sound/hallucinations/veryfar_noise.ogg', 50, TRUE)
to_chat(user, "<span class='shadowling'>You instantly rearrange <b>[target]</b>'s memories, hyptonitizing [target.p_them()] into a thrall.</span>")
to_chat(target, "<span class='userdanger'><font size=3>An agonizing spike of pain drives into your mind, and--</font></span>")
Expand Down
28 changes: 28 additions & 0 deletions code/game/gamemodes/wizard/spellbook.dm
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,17 @@
initialize()


/obj/item/spellbook/magic_charge_act(mob/user)
. = RECHARGE_SUCCESSFUL|RECHARGE_BURNOUT

to_chat(user, span_caution("Glowing red letters appear on the front cover..."))
to_chat(user, span_warning(pick("NICE TRY BUT NO!", \
"CLEVER BUT NOT CLEVER ENOUGH!", \
"SUCH FLAGRANT CHEESING IS WHY WE ACCEPTED YOUR APPLICATION!", \
"CUTE!", \
"YOU DIDN'T THINK IT'D BE THAT EASY, DID YOU?")))


/obj/item/spellbook/attackby(obj/item/I, mob/living/user, params)
if(user.a_intent == INTENT_HARM || skip_refunds)
return ..()
Expand Down Expand Up @@ -1016,6 +1027,23 @@
uses = 1
desc = "This template spellbook was never meant for the eyes of man..."


/obj/item/spellbook/oneuse/magic_charge_act(mob/user)
. = NONE

if(!used)
return

used = FALSE
. |= RECHARGE_SUCCESSFUL

if(prob(80))
visible_message(span_warning("[src] catches fire!"))
user.temporarily_remove_item_from_inventory(src)
qdel(src)
. |= RECHARGE_BURNOUT


/obj/item/spellbook/oneuse/New()
..()
name += spellname
Expand Down
Loading

0 comments on commit 0c8fb00

Please sign in to comment.