From da3da4455f49e01e08b391d34df1a771e53117bc Mon Sep 17 00:00:00 2001 From: Pinta <124479862+deertools@users.noreply.github.com> Date: Fri, 10 Feb 2023 21:01:58 -0500 Subject: [PATCH 1/3] basic touch spells --- GainStation13/code/mechanics/fatness.dm | 69 ++++++++++-------- GainStation13/code/mechanics/spells.dm | 95 +++++++++++++++++++++++++ tgstation.dme | 1 + 3 files changed, 137 insertions(+), 28 deletions(-) create mode 100644 GainStation13/code/mechanics/spells.dm diff --git a/GainStation13/code/mechanics/fatness.dm b/GainStation13/code/mechanics/fatness.dm index db33321a..df6750bb 100644 --- a/GainStation13/code/mechanics/fatness.dm +++ b/GainStation13/code/mechanics/fatness.dm @@ -17,34 +17,8 @@ return FALSE if(!HAS_TRAIT(src, TRAIT_UNIVERSAL_GAINER) && client?.prefs) - switch(type_of_fattening) - if(FATTENING_TYPE_ITEM) - if(!client.prefs.weight_gain_items) - return FALSE - - if(FATTENING_TYPE_FOOD) - if(!client.prefs.weight_gain_food) - return FALSE - - if(FATTENING_TYPE_CHEM) - if(!client.prefs.weight_gain_chems) - return FALSE - - if(FATTENING_TYPE_WEAPON) - if(!client.prefs.weight_gain_weapons) - return FALSE - - if(FATTENING_TYPE_MAGIC) - if(!client.prefs.weight_gain_magic) - return FALSE - - if(FATTENING_TYPE_VIRUS) - if(!client.prefs.weight_gain_viruses) - return FALSE - - if(FATTENING_TYPE_WEIGHT_LOSS) - if(HAS_TRAIT(src, TRAIT_WEIGHT_LOSS_IMMUNE)) - return FALSE + if(!check_weight_prefs(type_of_fattening)) + return FALSE var/amount_to_change = adjustment_amount if(adjustment_amount > 0) @@ -60,3 +34,42 @@ /mob/living/carbon/fully_heal(admin_revive) fatness = 0 . = ..() + +///Checks the parent mob's prefs to see if they can be fattened by the fattening_type +/mob/living/carbon/proc/check_weight_prefs(type_of_fattening = FATTENING_TYPE_ITEM) + if(HAS_TRAIT(src, TRAIT_UNIVERSAL_GAINER) && !client.prefs) //Comment this second part out + return TRUE + + if(!client?.prefs || !type_of_fattening) + return FALSE + + switch(type_of_fattening) + if(FATTENING_TYPE_ITEM) + if(!client.prefs.weight_gain_items) + return FALSE + + if(FATTENING_TYPE_FOOD) + if(!client.prefs.weight_gain_food) + return FALSE + + if(FATTENING_TYPE_CHEM) + if(!client.prefs.weight_gain_chems) + return FALSE + + if(FATTENING_TYPE_WEAPON) + if(!client.prefs.weight_gain_weapons) + return FALSE + + if(FATTENING_TYPE_MAGIC) + if(!client.prefs.weight_gain_magic) + return FALSE + + if(FATTENING_TYPE_VIRUS) + if(!client.prefs.weight_gain_viruses) + return FALSE + + if(FATTENING_TYPE_WEIGHT_LOSS) + if(HAS_TRAIT(src, TRAIT_WEIGHT_LOSS_IMMUNE)) + return FALSE + + return TRUE diff --git a/GainStation13/code/mechanics/spells.dm b/GainStation13/code/mechanics/spells.dm new file mode 100644 index 00000000..6461d7c3 --- /dev/null +++ b/GainStation13/code/mechanics/spells.dm @@ -0,0 +1,95 @@ +/obj/effect/proc_holder/spell/targeted/touch/add_weight + name = "Fattening touch" + desc = "Channel fattening energy to your hand to fatten people with." + drawmessage = "You channel fattening energy into your hand." + dropmessage = "You let the fattening energy from your hand dissipate." + hand_path = /obj/item/melee/touch_attack/fattening + charge_max = 400 + clothes_req = FALSE + action_icon_state = "zap" + +/obj/effect/proc_holder/spell/targeted/touch/add_weight/transfer + name = "Weight transfer" + hand_path = /obj/item/melee/touch_attack/fattening/transfer + +/obj/effect/proc_holder/spell/targeted/touch/add_weight/steal + name = "Weight steal" + hand_path = /obj/item/melee/touch_attack/fattening/steal + + +/obj/item/melee/touch_attack/fattening + name = "\improper fattening touch" + desc = "The calories from multiple donuts compressed into pure energy." + catchphrase = null + on_use_sound = 'sound/weapons/zapbang.ogg' + icon_state = "zapper" + item_state = "zapper" + ///How much weight is added? + var/weight_to_add = 100 + ///What verb is used for the spell? + var/fattening_verb = "fattens" + ///Is weight being transfered from the user to another mob? + +/obj/item/melee/touch_attack/fattening/afterattack(atom/target, mob/living/carbon/user, proximity) + if(!proximity || !isliving(target)) + return FALSE + + var/mob/living/carbon/gainer = target + if(!gainer || !weight_to_add) + return FALSE + + if(!gainer.adjust_fatness(weight_to_add, FATTENING_TYPE_MAGIC)) + to_chat(user,"") + return FALSE + + gainer.visible_message("[user] [fattening_verb] [target]!","[user] [fattening_verb] you!") + return ..() + +/obj/item/melee/touch_attack/fattening/transfer + name = "\improper weight transfer touch" + desc = "Your weight compressed into a fattening energy." + fattening_verb = "transfers weight to" + +/obj/item/melee/touch_attack/fattening/transfer/afterattack(atom/target, mob/living/carbon/user, proximity) + if(weight_to_add > user.fatness || !user.adjust_fatness(-weight_to_add, FATTENING_TYPE_MAGIC)) + to_chat(user, "") + return FALSE + + return ..() + +/obj/item/melee/touch_attack/fattening/steal + name = "\improper weight theft touch" + desc = "Energy that is eager to take weight." + fattening_verb = "steals weight from" + weight_to_add = -100 + +/obj/item/melee/touch_attack/fattening/steal/afterattack(atom/target, mob/living/carbon/user, proximity) + var/mob/living/carbon/loser = target + if(loser.fatness < -weight_to_add) + to_chat(user, "") + return FALSE + + . = ..() + if(. != null && !.) + return FALSE + + user.adjust_fatness(-weight_to_add, FATTENING_TYPE_MAGIC) + +///Spellbooks +/obj/item/book/granter/spell/fattening + spell = /obj/effect/proc_holder/spell/targeted/touch/add_weight + spellname = "fattening" + icon_state ="bookfireball" + desc = "This book feels warm to the touch." + +/obj/item/book/granter/spell/fattening/transfer + spell = /obj/effect/proc_holder/spell/targeted/touch/add_weight/transfer + spellname = "weight transfer" + icon_state ="bookfireball" + desc = "This book feels warm to the touch." + +/obj/item/book/granter/spell/fattening/steal + spell = /obj/effect/proc_holder/spell/targeted/touch/add_weight/steal + spellname = "weight steal" + icon_state ="bookfireball" + desc = "This book feels warm to the touch." diff --git a/tgstation.dme b/tgstation.dme index de346663..09c83786 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3317,6 +3317,7 @@ #include "code\modules\zombie\items.dm" #include "code\modules\zombie\organs.dm" #include "GainStation13\code\mechanics\fatness.dm" +#include "GainStation13\code\mechanics\spells.dm" #include "GainStation13\code\modules\client\preferences\preferences.dm" #include "GainStation13\code\modules\mob\living\emote.dm" #include "GainStation13\code\modules\reagents\chemistry\reagents\consumable_reagents.dm" From 5767e01f2ca204971823449a2adf7bd8de14c10e Mon Sep 17 00:00:00 2001 From: Pinta <124479862+deertools@users.noreply.github.com> Date: Fri, 10 Feb 2023 23:46:21 -0500 Subject: [PATCH 2/3] icons --- GainStation13/code/mechanics/spells.dm | 34 ++++++++++++------ .../icons/obj/spells/spell_items.dmi | Bin 0 -> 909 bytes GainStation13/icons/obj/spells/spellbooks.dmi | Bin 0 -> 518 bytes 3 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 GainStation13/icons/obj/spells/spell_items.dmi create mode 100644 GainStation13/icons/obj/spells/spellbooks.dmi diff --git a/GainStation13/code/mechanics/spells.dm b/GainStation13/code/mechanics/spells.dm index 6461d7c3..49a70b84 100644 --- a/GainStation13/code/mechanics/spells.dm +++ b/GainStation13/code/mechanics/spells.dm @@ -1,37 +1,39 @@ /obj/effect/proc_holder/spell/targeted/touch/add_weight - name = "Fattening touch" + name = "Fattening" desc = "Channel fattening energy to your hand to fatten people with." drawmessage = "You channel fattening energy into your hand." dropmessage = "You let the fattening energy from your hand dissipate." hand_path = /obj/item/melee/touch_attack/fattening - charge_max = 400 + action_icon_state = "spell_default" + charge_max = 200 clothes_req = FALSE - action_icon_state = "zap" /obj/effect/proc_holder/spell/targeted/touch/add_weight/transfer name = "Weight transfer" hand_path = /obj/item/melee/touch_attack/fattening/transfer + charge_max = 100 /obj/effect/proc_holder/spell/targeted/touch/add_weight/steal name = "Weight steal" hand_path = /obj/item/melee/touch_attack/fattening/steal - + charge_max = 100 /obj/item/melee/touch_attack/fattening name = "\improper fattening touch" desc = "The calories from multiple donuts compressed into pure energy." catchphrase = null - on_use_sound = 'sound/weapons/zapbang.ogg' - icon_state = "zapper" - item_state = "zapper" + on_use_sound = 'sound/weapons/pulse.ogg' + icon = 'GainStation13/icons/obj/spells/spell_items.dmi' + icon_state = "add-hand" ///How much weight is added? var/weight_to_add = 100 ///What verb is used for the spell? var/fattening_verb = "fattens" ///Is weight being transfered from the user to another mob? + /obj/item/melee/touch_attack/fattening/afterattack(atom/target, mob/living/carbon/user, proximity) - if(!proximity || !isliving(target)) + if(!proximity || !isliving(target) || target == user) return FALSE var/mob/living/carbon/gainer = target @@ -49,8 +51,12 @@ name = "\improper weight transfer touch" desc = "Your weight compressed into a fattening energy." fattening_verb = "transfers weight to" + icon_state = "transfer-hand" /obj/item/melee/touch_attack/fattening/transfer/afterattack(atom/target, mob/living/carbon/user, proximity) + if(!proximity || !target || target == user) + return FALSE + if(weight_to_add > user.fatness || !user.adjust_fatness(-weight_to_add, FATTENING_TYPE_MAGIC)) to_chat(user, "") return FALSE @@ -62,9 +68,13 @@ desc = "Energy that is eager to take weight." fattening_verb = "steals weight from" weight_to_add = -100 + icon_state = "steal-hand" /obj/item/melee/touch_attack/fattening/steal/afterattack(atom/target, mob/living/carbon/user, proximity) var/mob/living/carbon/loser = target + if(!proximity || !loser || target == user) + return FALSE + if(loser.fatness < -weight_to_add) to_chat(user, "") return FALSE @@ -79,17 +89,19 @@ /obj/item/book/granter/spell/fattening spell = /obj/effect/proc_holder/spell/targeted/touch/add_weight spellname = "fattening" - icon_state ="bookfireball" + icon = 'GainStation13/icons/obj/spells/spellbooks.dmi' + icon_state = "add_weight" desc = "This book feels warm to the touch." + page_time = 10 /obj/item/book/granter/spell/fattening/transfer spell = /obj/effect/proc_holder/spell/targeted/touch/add_weight/transfer spellname = "weight transfer" - icon_state ="bookfireball" + icon_state = "transfer_weight" desc = "This book feels warm to the touch." /obj/item/book/granter/spell/fattening/steal spell = /obj/effect/proc_holder/spell/targeted/touch/add_weight/steal spellname = "weight steal" - icon_state ="bookfireball" + icon_state = "steal_weight" desc = "This book feels warm to the touch." diff --git a/GainStation13/icons/obj/spells/spell_items.dmi b/GainStation13/icons/obj/spells/spell_items.dmi new file mode 100644 index 0000000000000000000000000000000000000000..b1aa6c3f3f8638606dea929dd2e9f7781f761a5f GIT binary patch literal 909 zcmV;819JR{P)jw(qv?z`(#U($Z|--yo8cw(akdcK!$e z0004WQchCV=-0C=2JR&a84_w-Y6@%7{?OD!tS z%+FJ>RWQ*r;NmRLOex6#a*U0*I5Sc+(=$pSoZ^zil2jm5DKRBQHzP4GMTv_uC9|j) zC}haRnO2mTn+jpW6_ykw<`t)<77?eqxFj_(2d`3P1y?^8u#*84k~K!qZ^AGTBkw+xr2qfd&c0l;z!P?G6GA62cc^R#oxt9s3dTh9KufST+51}B+tIlgL_~eCZ_cqUSWNL8{Ty%?i z`QA@VEv`ka!uq@XEJOK74)UR09TLJ&- zcp#Q=mhbb_@R8bGLpzj#9%uHO$pE0;H?&7t=<#;HnM~iPcIVWBVWw@kn7&o*-m3-6 zOm(=z+?qS124vw;L>cBVx8~le0aeEf))*Nu)N-e5Otaawig}fe$r_Y*j{un+$Lq{*cdNADh=3_e(rM~ z<1bic(E4rvQ=j@nmER>O?+PgINys5|g8T|q$hqd%w6wQtDYeSiS_d&l@Y=7|Tm_G3 z3Xd^Y_`rU-NysE9wFuS0;{ShTYIPG_Et`5dh@W5qwjlxxVB+U-I2va3E9fmyFr6ik z>P)t-sz`(%& zeKMIf9+?1UnKPN!zjxreY4g>1_u-%Z?!5n_GR!lX|Bo~OGynSk_y73!|JttquJ^#e zz%up!9*mhX&;K*z|M~a-uI>Mo#>3?R0004WQchCV=-0C=2JR&a84_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRLOex6#a*U0*I5Sc+(=$pS zoZ^zil2jm5DKRA_z8ox}#KoDCSyT)ZH00t;D@x2wg|OjDONtWniqleyh*e))lA4%9 zK(VrdtDg(l;Q;LFIHTwQkxu{s0N+VOK~z|U?bX>1!XOYp(JmBFyFgmC|No`hNt+H~ z(?LyRxUYnhKv;?*cc9A3$QrMikz;V7@iL(J#?V zTOR;q2B^RtN(SbHCCtzh5UG2R0V;s5GYPPx# literal 0 HcmV?d00001 From 2c15f7291f80a8b7c864e70f1963d16b09f4465b Mon Sep 17 00:00:00 2001 From: Pinta <124479862+deertools@users.noreply.github.com> Date: Sat, 11 Feb 2023 02:20:29 -0500 Subject: [PATCH 3/3] Update spells.dm --- GainStation13/code/mechanics/spells.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/GainStation13/code/mechanics/spells.dm b/GainStation13/code/mechanics/spells.dm index 49a70b84..8a020396 100644 --- a/GainStation13/code/mechanics/spells.dm +++ b/GainStation13/code/mechanics/spells.dm @@ -33,7 +33,7 @@ /obj/item/melee/touch_attack/fattening/afterattack(atom/target, mob/living/carbon/user, proximity) - if(!proximity || !isliving(target) || target == user) + if(!proximity || !iscarbon(target) || target == user) return FALSE var/mob/living/carbon/gainer = target @@ -72,7 +72,7 @@ /obj/item/melee/touch_attack/fattening/steal/afterattack(atom/target, mob/living/carbon/user, proximity) var/mob/living/carbon/loser = target - if(!proximity || !loser || target == user) + if(!proximity || !iscarbon(target) || target == user) return FALSE if(loser.fatness < -weight_to_add) @@ -87,6 +87,7 @@ ///Spellbooks /obj/item/book/granter/spell/fattening + name = "fattening tome" spell = /obj/effect/proc_holder/spell/targeted/touch/add_weight spellname = "fattening" icon = 'GainStation13/icons/obj/spells/spellbooks.dmi' @@ -95,12 +96,14 @@ page_time = 10 /obj/item/book/granter/spell/fattening/transfer + name = "weight transfer tome" spell = /obj/effect/proc_holder/spell/targeted/touch/add_weight/transfer spellname = "weight transfer" icon_state = "transfer_weight" desc = "This book feels warm to the touch." /obj/item/book/granter/spell/fattening/steal + name = "weight steal tome" spell = /obj/effect/proc_holder/spell/targeted/touch/add_weight/steal spellname = "weight steal" icon_state = "steal_weight"