diff --git a/code/__DEFINES/melee.dm b/code/__DEFINES/melee.dm new file mode 100644 index 0000000000..cb4a433211 --- /dev/null +++ b/code/__DEFINES/melee.dm @@ -0,0 +1,10 @@ +//Martial arts defines + +#define MARTIALART_BOXING "boxing" +#define MARTIALART_WRESTLING "wrestling" +#define MARTIALART_SLEEPINGCARP "sleeping carp" +#define MARTIALART_PSYCHOBRAWL "psychotic brawling" +#define MARTIALART_MUSHPUNCH "mushroom punch" +#define MARTIALART_KRAVMAGA "krav maga" +#define MARTIALART_CQC "CQC" +#define MARTIALART_PLASMAFIST "plasma fist" \ No newline at end of file diff --git a/code/datums/martial.dm b/code/datums/martial.dm index ae8f92a342..d119759efc 100644 --- a/code/datums/martial.dm +++ b/code/datums/martial.dm @@ -2,6 +2,7 @@ var/name = "Martial Art" var/streak = "" var/max_streak_length = 6 + var/id = "" //ID, used by mind/has_martialartcode\game\objects\items\granters.dm:345:error: user.mind.has_martialart: undefined proccode\game\objects\items\granters.dm:345:error: user.mind.has_martialart: undefined proccode\game\objects\items\granters.dm:345:error: user.mind.has_martialart: undefined proccode\game\objects\items\granters.dm:345:error: user.mind.has_martialart: undefined proccode\game\objects\items\granters.dm:345:error: user.mind.has_martialart: undefined proc var/current_target var/datum/martial_art/base // The permanent style. This will be null unless the martial art is temporary var/deflection_chance = 0 //Chance to deflect projectiles diff --git a/code/datums/martial/boxing.dm b/code/datums/martial/boxing.dm index c93fc47f2b..7399528e1c 100644 --- a/code/datums/martial/boxing.dm +++ b/code/datums/martial/boxing.dm @@ -1,5 +1,6 @@ /datum/martial_art/boxing name = "Boxing" + id = MARTIALART_BOXING /datum/martial_art/boxing/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) to_chat(A, "Can't disarm while boxing!") diff --git a/code/datums/martial/cqc.dm b/code/datums/martial/cqc.dm index 55cd4a3f7a..71545476ff 100644 --- a/code/datums/martial/cqc.dm +++ b/code/datums/martial/cqc.dm @@ -6,6 +6,7 @@ /datum/martial_art/cqc name = "CQC" + id = MARTIALART_CQC help_verb = /mob/living/carbon/human/proc/CQC_help block_chance = 75 var/just_a_cook = FALSE diff --git a/code/datums/martial/krav_maga.dm b/code/datums/martial/krav_maga.dm index cdf932e127..13ba942edd 100644 --- a/code/datums/martial/krav_maga.dm +++ b/code/datums/martial/krav_maga.dm @@ -1,5 +1,6 @@ /datum/martial_art/krav_maga name = "Krav Maga" + id = MARTIALART_KRAVMAGA var/datum/action/neck_chop/neckchop = new/datum/action/neck_chop() var/datum/action/leg_sweep/legsweep = new/datum/action/leg_sweep() var/datum/action/lung_punch/lungpunch = new/datum/action/lung_punch() diff --git a/code/datums/martial/mushpunch.dm b/code/datums/martial/mushpunch.dm index 33d5bb51bf..1ef7734771 100644 --- a/code/datums/martial/mushpunch.dm +++ b/code/datums/martial/mushpunch.dm @@ -1,5 +1,6 @@ /datum/martial_art/mushpunch name = "Mushroom Punch" + id = MARTIALART_MUSHPUNCH /datum/martial_art/mushpunch/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) var/atk_verb diff --git a/code/datums/martial/plasma_fist.dm b/code/datums/martial/plasma_fist.dm index f540dc0783..e38a011db0 100644 --- a/code/datums/martial/plasma_fist.dm +++ b/code/datums/martial/plasma_fist.dm @@ -4,6 +4,7 @@ /datum/martial_art/plasma_fist name = "Plasma Fist" + id = MARTIALART_PLASMAFIST help_verb = /mob/living/carbon/human/proc/plasma_fist_help diff --git a/code/datums/martial/psychotic_brawl.dm b/code/datums/martial/psychotic_brawl.dm index 1cb18f903f..8f1a33a8b3 100644 --- a/code/datums/martial/psychotic_brawl.dm +++ b/code/datums/martial/psychotic_brawl.dm @@ -1,5 +1,6 @@ /datum/martial_art/psychotic_brawling name = "Psychotic Brawling" + id = MARTIALART_PSYCHOBRAWL /datum/martial_art/psychotic_brawling/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) return psycho_attack(A,D) diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index 5f19c37b99..e205d7a435 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -6,6 +6,7 @@ /datum/martial_art/the_sleeping_carp name = "The Sleeping Carp" + id = MARTIALART_SLEEPINGCARP deflection_chance = 100 reroute_deflection = TRUE no_guns = TRUE diff --git a/code/datums/martial/wrestling.dm b/code/datums/martial/wrestling.dm index e57edf9fb2..e07fa27ef5 100644 --- a/code/datums/martial/wrestling.dm +++ b/code/datums/martial/wrestling.dm @@ -10,6 +10,7 @@ /datum/martial_art/wrestling name = "Wrestling" + id = MARTIALART_WRESTLING var/datum/action/slam/slam = new/datum/action/slam() var/datum/action/throw_wrassle/throw_wrassle = new/datum/action/throw_wrassle() var/datum/action/kick/kick = new/datum/action/kick() diff --git a/code/datums/mind.dm b/code/datums/mind.dm index e50c89c0ac..8e61801e15 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -781,6 +781,11 @@ mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist) mind.active = 1 //indicates that the mind is currently synced with a client +/datum/mind/proc/has_martialart(var/string) + if(martial_art && martial_art.id == string) + return martial_art + return FALSE + /mob/dead/new_player/sync_mind() return diff --git a/code/game/objects/items/granters.dm b/code/game/objects/items/granters.dm index 4d66cd09f7..686c6fd511 100644 --- a/code/game/objects/items/granters.dm +++ b/code/game/objects/items/granters.dm @@ -41,8 +41,6 @@ if(reading) to_chat(user, "You're already reading this!") return FALSE - if(!user.can_read(src)) - return FALSE if(already_known(user)) return FALSE if(used && oneuse) @@ -84,6 +82,31 @@ G.Grant(user) onlearned(user) +/obj/item/book/granter/action/drink_fling + granted_action = /datum/action/innate/drink_fling + name = "Tapper: This One's For You" + desc = "A seminal work on the dying art of booze sliding." + icon_state = "barbook" + actionname = "drink flinging" + oneuse = FALSE + remarks = list("The trick is keeping a low center of gravity it seems...", "The viscosity of the liquid is important...", "Accounting for crosswinds... really?", "Drag coefficients of various popular drinking glasses...", "What the heck is laminar flow and why does it matter here?", "Greasing the bar seems like it'd be cheating...", "I don't think I'll be working with superfluids...") + +/datum/action/innate/drink_fling + name = "Drink Flinging" + desc = "Toggles your ability to satisfyingly throw glasses without spilling them." + button_icon_state = "drinkfling_off" + check_flags = 0 + +/datum/action/innate/drink_fling/Activate() + button_icon_state = "drinkfling_on" + active = TRUE + UpdateButtonIcon() + +/datum/action/innate/drink_fling/Deactivate() + button_icon_state = "drinkfling_off" + active = FALSE + UpdateButtonIcon() + /obj/item/book/granter/action/origami granted_action = /datum/action/innate/origami name = "The Art of Origami" @@ -181,9 +204,9 @@ ..() to_chat(user,"Your stomach rumbles...") if(user.nutrition) - user.set_nutrition(200) + user.nutrition = 200 if(user.nutrition <= 0) - user.set_nutrition(0) + user.nutrition = 0 /obj/item/book/granter/spell/blind spell = /obj/effect/proc_holder/spell/targeted/trigger/blind @@ -315,7 +338,6 @@ var/martialname = "bug jitsu" var/greet = "You feel like you have mastered the art in breaking code. Nice work, jackass." - /obj/item/book/granter/martial/already_known(mob/user) if(!martial) return TRUE @@ -408,4 +430,4 @@ for(var/crafting_recipe_type in crafting_recipe_types) var/datum/crafting_recipe/R = crafting_recipe_type user.mind.teach_crafting_recipe(crafting_recipe_type) -to_chat(user,"You learned how to make [initial(R.name)].") \ No newline at end of file + to_chat(user,"You learned how to make [initial(R.name)].") \ No newline at end of file diff --git a/code/game/objects/items/implants/implant_krav_maga.dm b/code/game/objects/items/implants/implant_krav_maga.dm index 3a751ecd0e..373658b386 100644 --- a/code/game/objects/items/implants/implant_krav_maga.dm +++ b/code/game/objects/items/implants/implant_krav_maga.dm @@ -21,7 +21,7 @@ return if(!H.mind) return - if(istype(H.mind.martial_art, /datum/martial_art/krav_maga)) + if(H.mind.has_martialart(MARTIALART_KRAVMAGA)) style.remove(H) else style.teach(H,1) diff --git a/tgstation.dme b/tgstation.dme index 24477d885b..7e7b5a00c9 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -62,6 +62,7 @@ #include "code\__DEFINES\maths.dm" #include "code\__DEFINES\MC.dm" #include "code\__DEFINES\medal.dm" +#include "code\__DEFINES\melee.dm" #include "code\__DEFINES\menu.dm" #include "code\__DEFINES\misc.dm" #include "code\__DEFINES\mobs.dm"