From b900fcdafc284e0e8233cc4693a2bb243e8a70b1 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 29 Sep 2024 13:55:30 -0500 Subject: [PATCH] removing unatomic changes --- code/__DEFINES/combat.dm | 8 +- code/__DEFINES/is_helpers.dm | 3 - code/datums/components/melee/parry.dm | 148 ------------------- code/game/atoms_movable.dm | 3 - code/game/objects/items.dm | 12 +- code/game/objects/items/hot_potato.dm | 4 +- code/game/objects/items/melee/bladeatheon.dm | 57 ------- code/modules/projectiles/gun.dm | 2 - code/modules/projectiles/guns/ballistic.dm | 1 - shiptest.dme | 2 - 10 files changed, 5 insertions(+), 235 deletions(-) delete mode 100644 code/datums/components/melee/parry.dm delete mode 100644 code/game/objects/items/melee/bladeatheon.dm diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm index 50f2031db795..6fa77815ff2b 100644 --- a/code/__DEFINES/combat.dm +++ b/code/__DEFINES/combat.dm @@ -46,7 +46,7 @@ #define CLICK_CD_CLICK_ABILITY 6 #define CLICK_CD_BREAKOUT 100 #define CLICK_CD_HANDCUFFED 10 -#define CLICK_CD_RESIST 1 +#define CLICK_CD_RESIST 20 #define CLICK_CD_GRABBING 10 #define CLICK_CD_LOOK_UP 5 @@ -74,12 +74,6 @@ #define PROJECTILE_ATTACK 3 #define THROWN_PROJECTILE_ATTACK 4 #define LEAP_ATTACK 5 -#define ALL_ATTACK_TYPES list(MELEE_ATTACK, UNARMED_ATTACK, PROJECTILE_ATTACK, THROWN_PROJECTILE_ATTACK, LEAP_ATTACK) -#define NON_PROJECTILE_ATTACKS list(MELEE_ATTACK, UNARMED_ATTACK, LEAP_ATTACK) - -// the standard parry time out time -#define PARRY_DEFAULT_TIMEOUT 0.75 SECONDS -#define PARRY_RIPOST 0.50 SECONDS //attack visual effects #define ATTACK_EFFECT_PUNCH "punch" diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index f872239f49fd..d1db31e6a4fc 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -10,9 +10,6 @@ #define isgenerator(A) (istype(A, /generator)) -#define isbadpath(A) (A == initial(A.bad_type)) -#define isbadtype(A) (A.type == A.bad_type) - //Turfs //#define isturf(A) (istype(A, /turf)) This is actually a byond built-in. Added here for completeness sake. diff --git a/code/datums/components/melee/parry.dm b/code/datums/components/melee/parry.dm deleted file mode 100644 index 4193df349364..000000000000 --- a/code/datums/components/melee/parry.dm +++ /dev/null @@ -1,148 +0,0 @@ -/datum/component/parry - /// the world.time we last parried at - var/time_parried - /// the max time since `time_parried` that the shield is still considered "active" - var/parry_time_out_time - - /// the flat amount of damage the shield user takes per non-perfect parry - var/stamina_constant - /// stamina_coefficient * damage * time_since_time_parried = stamina damage taken per non perfect parry - var/stamina_coefficient - /// the attack types that are considered for parrying - var/parryable_attack_types - /// the time between parry attempts - var/parry_cooldown - /// the cooldown you get when you parry an attack - var/riposte - - /// Text to be shown to users who examine the parent. Will list which type of attacks it can parry. - var/examine_text - /// Does this item have a require a condition to meet before being able to parry? This is for two handed weapons that can parry. (Default: FALSE) - var/requires_two_hands = FALSE - /// Does this item require activation? This is for activation based items or energy weapons. - var/requires_activation = FALSE - -/datum/component/parry/RegisterWithParent() - RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, PROC_REF(equipped)) - RegisterSignal(parent, COMSIG_ITEM_DROPPED, PROC_REF(dropped)) - RegisterSignal(parent, COMSIG_ITEM_HIT_REACT, PROC_REF(attempt_parry)) - RegisterSignal(parent, COMSIG_PARENT_EXAMINE, PROC_REF(on_parent_examined)) - -/datum/component/parry/UnregisterFromParent() - UnregisterSignal(parent, COMSIG_ITEM_EQUIPPED) - UnregisterSignal(parent, COMSIG_ITEM_DROPPED) - UnregisterSignal(parent, COMSIG_ITEM_HIT_REACT) - var/obj/item/I = parent - if(ismob(I.loc)) - UnregisterSignal(I.loc, COMSIG_LIVING_RESIST) - -/datum/component/parry/Initialize( - _stamina_constant = 0, - _stamina_coefficient = 0, - _parry_time_out_time = PARRY_DEFAULT_TIMEOUT, - _parry_cooldown = 0.75 SECONDS, - _riposte = PARRY_RIPOST, - _requires_two_hands = FALSE, - _requires_activation = FALSE, - _parryable_attack_types = ALL_ATTACK_TYPES -) - - if(!isitem(parent)) - return COMPONENT_INCOMPATIBLE - - stamina_constant = _stamina_constant - stamina_coefficient = _stamina_coefficient - parry_time_out_time = _parry_time_out_time - parry_cooldown = _parry_cooldown - riposte = _riposte - requires_two_hands = _requires_two_hands - requires_activation = _requires_activation - if(islist(_parryable_attack_types)) - parryable_attack_types = _parryable_attack_types - else - parryable_attack_types = list(_parryable_attack_types) - - var/static/list/attack_types_english = list( - MELEE_ATTACK = "melee attacks", - UNARMED_ATTACK = "unarmed attacks", - PROJECTILE_ATTACK = "projectiles", - THROWN_PROJECTILE_ATTACK = "thrown projectiles", - LEAP_ATTACK = "leap attacks" - ) - var/list/attack_list = list() - for(var/attack_type in parryable_attack_types) - attack_list += attack_types_english[attack_type] - - examine_text = span_notice("It's able to parry [english_list(attack_list)].") - -/datum/component/parry/proc/equipped(obj/item/source, mob/user, slot) - SIGNAL_HANDLER - if(slot == ITEM_SLOT_HANDS) - RegisterSignal(user, COMSIG_LIVING_RESIST, PROC_REF(start_parry)) - else - UnregisterSignal(user, COMSIG_LIVING_RESIST) - -/datum/component/parry/proc/dropped(obj/item/source, mob/user) - SIGNAL_HANDLER - - UnregisterSignal(user, COMSIG_LIVING_RESIST) - -/datum/component/parry/proc/start_parry(mob/living/L) - SIGNAL_HANDLER - var/time_since_parry = world.time - time_parried - if(L.stat != CONSCIOUS) - return - //if(requires_two_hands && !HAS_TRAIT(parent, TRAIT_WIELDED)) // If our item has special conditions before being able to parry. - // return - if(requires_activation && !HAS_TRAIT(parent, TRAIT_TRANSFORM_ACTIVE)) // If our item requires an activation to be able to parry. [E-sword / Teleshield, etc.] - return - if(time_since_parry < parry_cooldown) // stops spam - return - - time_parried = world.time - L.do_attack_animation(L, used_item = parent) - -/datum/component/parry/proc/attempt_parry(obj/item/source, mob/living/carbon/human/owner, atom/movable/hitby, damage = 0, attack_type = MELEE_ATTACK) - SIGNAL_HANDLER - if(!(attack_type in parryable_attack_types)) - return - var/time_since_parry = world.time - time_parried - if(time_since_parry > parry_time_out_time) - return - - var/armour_penetration_percentage = 0 - - if(isitem(hitby)) - var/obj/item/I = hitby - armour_penetration_percentage = I.armour_penetration - - if(isanimal(hitby)) - var/mob/living/simple_animal/animal = hitby - armour_penetration_percentage = animal.armour_penetration - - if(armour_penetration_percentage >= 100) - return - - var/stamina_damage = (stamina_coefficient * (((time_since_parry / parry_time_out_time) + armour_penetration_percentage / 100) * damage)) + stamina_constant - - var/sound_to_play - if(attack_type == PROJECTILE_ATTACK) - sound_to_play = pick('sound/weapons/effects/ric1.ogg', 'sound/weapons/effects/ric2.ogg', 'sound/weapons/effects/ric3.ogg', 'sound/weapons/effects/ric4.ogg', 'sound/weapons/effects/ric5.ogg') - else - sound_to_play = 'sound/weapons/parry.ogg' - - playsound(owner, sound_to_play, clamp(stamina_damage, 40, 120)) - //Riposte! - if(riposte != -1) - source.balloon_alert(owner, "Riposte!") - owner.changeNext_move(riposte) - - to_chat(owner, "stamina_damage [stamina_damage] time_since_part [time_since_parry] parry_time_out_time [parry_time_out_time] armour_pen [armour_penetration_percentage] damage [damage] stam_const [stamina_constant] stam_coef [stamina_coefficient]") - owner.adjustStaminaLoss(stamina_damage) - if(owner.getStaminaLoss() < 100) - return COMPONENT_HIT_REACTION_BLOCK - -/datum/component/parry/proc/on_parent_examined(obj/item/source, mob/user, list/examine_list) - SIGNAL_HANDLER - - examine_list += examine_text diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 43dd61509aa1..81bbeb7b337c 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -75,9 +75,6 @@ /// Whether a user will face atoms on entering them with a mouse. Despite being a mob variable, it is here for performance var/face_mouse = FALSE - /// Use path Ex:(bad_type = obj/item). Generally for abstract code objects, atoms with a set bad_type can never be selected by spawner and is ignored in some tests. Examples include parent objects which should only exist within the code. - var/bad_type - /atom/movable/Initialize(mapload) . = ..() switch(blocks_emissive) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 8c8032296cca..6f3a408c4993 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -15,7 +15,6 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb name = "item" icon = 'icons/obj/items.dmi' blocks_emissive = EMISSIVE_BLOCK_GENERIC - bad_type = /obj/item ///icon state name for inhand overlays var/item_state = null ///Icon file for left hand inhand overlays @@ -508,21 +507,14 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb // afterattack() and attack() prototypes moved to _onclick/item_attack.dm for consistency /obj/item/proc/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) - //Mostly shields + SEND_SIGNAL(src, COMSIG_ITEM_HIT_REACT, args) if((prob(final_block_chance) && COOLDOWN_FINISHED(src, block_cooldown)) || (prob(final_block_chance) && istype(src, /obj/item/shield))) owner.visible_message("[owner] blocks [attack_text] with [src]!") playsound(src, 'sound/weapons/effects/deflect.ogg', 100) if(!istype(src, /obj/item/shield)) COOLDOWN_START(src, block_cooldown, block_cooldown_time) return TRUE - - //Mostly parrying - var/signal_result = (SEND_SIGNAL(src, COMSIG_ITEM_HIT_REACT, owner, hitby, damage, attack_type)) + prob(final_block_chance) - if(!signal_result) - return FALSE - if(hit_reaction_chance >= 0) - owner.visible_message("[owner] blocks [attack_text] with [src]!") - return signal_result + return FALSE /obj/item/proc/talk_into(mob/M, input, channel, spans, datum/language/language, list/message_mods) return ITALICS | REDUCE_RANGE diff --git a/code/game/objects/items/hot_potato.dm b/code/game/objects/items/hot_potato.dm index 0cac490ee9f4..e3f21a70463e 100644 --- a/code/game/objects/items/hot_potato.dm +++ b/code/game/objects/items/hot_potato.dm @@ -96,9 +96,9 @@ . = ..() if(!adjacent || !ismob(target)) return - active_forceto(target, user) + force_onto(target, user) -/obj/item/hot_potato/proc/active_forceto(mob/living/victim, mob/user) +/obj/item/hot_potato/proc/force_onto(mob/living/victim, mob/user) if(!istype(victim) || user != loc || victim == user) return FALSE if(!victim.client) diff --git a/code/game/objects/items/melee/bladeatheon.dm b/code/game/objects/items/melee/bladeatheon.dm deleted file mode 100644 index d019163bc774..000000000000 --- a/code/game/objects/items/melee/bladeatheon.dm +++ /dev/null @@ -1,57 +0,0 @@ -/obj/item/clothing/shoes/blade_skates - name = "bladeatheon skates" - desc = "wip." - icon_state = "iceboots" //Need sprites - item_state = "iceboots" - clothing_flags = NOSLIP_ICE - lace_time = 12 SECONDS - -/obj/item/melee/fimbo_stick - name = "fimbo" - -/obj/item/melee/sword/pedang - name = "pedang" - desc = "an electrically-charged fencing sword." - icon_state = "suns-tsword" - force = 10 - hitsound = 'sound/weapons/rapierhit.ogg' - attack_verb = list("pierced", "swipe", "slash", "chop") - self_stam_const = 5 - self_stam_coef = 0.5 - riposte = 0.1 SECONDS - -/obj/item/melee/sword/pedang/Initialize() - . = ..() - RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform)) - -/obj/item/melee/sword/pedang/ComponentInitialize() - . = ..() - AddComponent( \ - /datum/component/transforming/charged, \ - force_on = 5, \ - throwforce_on = 10, \ - hitsound_on = hitsound, \ - _allowed_cells = list(/obj/item/stock_parts/cell/melee/pedang), \ - _preload_cell_type = /obj/item/stock_parts/cell/melee/pedang, \ - _cell_hit_cost = 250, \ - _can_remove_cell = TRUE, \ - ) - -/obj/item/melee/sword/pedang/proc/on_transform(obj/item/source, mob/user, active) - SIGNAL_HANDLER - - playsound(src, SFX_SPARKS, 75, TRUE, -1) - return COMPONENT_NO_DEFAULT_MESSAGE - -/obj/item/melee/sword/pedang/attack(mob/living/M, mob/living/user) - . = ..() - if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE)) - SEND_SIGNAL(src, COMSIG_ITEM_USE_CELL) - playsound(src, 'sound/weapons/egloves.ogg', 75, TRUE) - M.apply_damage(25, STAMINA, BODY_ZONE_CHEST) - -/obj/item/stock_parts/cell/melee - maxcharge = 5000 - -/obj/item/stock_parts/cell/melee/pedang - name = "compact pedang cell" diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 34f02e8364b3..b59a1530a209 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -21,8 +21,6 @@ //trigger guard on the weapon, hulks can't fire them with their big meaty fingers trigger_guard = TRIGGER_GUARD_NORMAL - bad_type = /obj/item/gun - ///The manufacturer of this weapon. For flavor mostly. If none, this will not show. var/manufacturer = MANUFACTURER_NONE diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 77b294c516d0..7e75b66254a5 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -9,7 +9,6 @@ desc = "Now comes in flavors like GUN. Uses 10mm ammo, for some reason." name = "projectile gun" w_class = WEIGHT_CLASS_NORMAL - bad_type = /obj/item/gun/ballistic has_safety = TRUE safety = TRUE diff --git a/shiptest.dme b/shiptest.dme index a4ff20a2d2a7..6211d837d05f 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -583,7 +583,6 @@ #include "code\datums\components\food\edible.dm" #include "code\datums\components\food\food_storage.dm" #include "code\datums\components\melee\charged.dm" -#include "code\datums\components\melee\parry.dm" #include "code\datums\components\melee\transforming.dm" #include "code\datums\components\melee\twohanded.dm" #include "code\datums\components\plumbing\_plumbing.dm" @@ -1315,7 +1314,6 @@ #include "code\game\objects\items\implants\implanter.dm" #include "code\game\objects\items\implants\implantpad.dm" #include "code\game\objects\items\implants\implantuplink.dm" -#include "code\game\objects\items\melee\bladeatheon.dm" #include "code\game\objects\items\melee\chainsaw.dm" #include "code\game\objects\items\melee\dualsaber.dm" #include "code\game\objects\items\melee\energy.dm"