diff --git a/_maps/RandomRuins/BeachRuins/beach_treasure_cove.dmm b/_maps/RandomRuins/BeachRuins/beach_treasure_cove.dmm index fbf9bf8ed4eb..a427310ff104 100644 --- a/_maps/RandomRuins/BeachRuins/beach_treasure_cove.dmm +++ b/_maps/RandomRuins/BeachRuins/beach_treasure_cove.dmm @@ -1101,7 +1101,7 @@ pixel_x = -6; pixel_y = 10 }, -/obj/item/melee/transforming/energy/sword/saber/pirate/red{ +/obj/item/melee/energy/sword/saber/pirate/red{ pixel_y = 8; pixel_x = 10 }, diff --git a/_maps/RandomRuins/JungleRuins/jungle_cavecrew.dmm b/_maps/RandomRuins/JungleRuins/jungle_cavecrew.dmm index 72e946c220a7..fbaaf2c7dd9e 100644 --- a/_maps/RandomRuins/JungleRuins/jungle_cavecrew.dmm +++ b/_maps/RandomRuins/JungleRuins/jungle_cavecrew.dmm @@ -2410,7 +2410,7 @@ pixel_y = -8; pixel_x = 5 }, -/obj/item/melee/transforming/energy/sword/saber/pirate/red, +/obj/item/melee/energy/sword/saber/pirate/red, /turf/open/floor/wood, /area/ruin/jungle/cavecrew/dormitories) "Dh" = ( diff --git a/_maps/RandomRuins/LavaRuins/lavaland_crashed_starwalker.dmm b/_maps/RandomRuins/LavaRuins/lavaland_crashed_starwalker.dmm index e0a98de791fc..47d8eb8a5b41 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_crashed_starwalker.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_crashed_starwalker.dmm @@ -2480,7 +2480,7 @@ icon_state = "gib3-old"; pixel_x = -6 }, -/obj/item/melee/transforming/energy/sword/saber/pirate/yellow{ +/obj/item/melee/energy/sword/saber/pirate/yellow{ pixel_x = -5; pixel_y = 16 }, diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_lava_canyon.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_lava_canyon.dmm index 6ad3e8ba7458..7626a3ff9a6b 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_surface_lava_canyon.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_lava_canyon.dmm @@ -883,7 +883,7 @@ /area/overmap_encounter/planetoid/lava/explored) "zb" = ( /mob/living/simple_animal/hostile/megafauna/blood_drunk_miner{ - loot = list(/obj/item/melee/transforming/cleaving_saw,/obj/item/gun/energy/kinetic_accelerator,/obj/item/keycard/gatedrop/lavacanyon) + loot = list(/obj/item/melee/cleaving_saw,/obj/item/gun/energy/kinetic_accelerator,/obj/item/keycard/gatedrop/lavacanyon) }, /turf/open/floor/plating/asteroid/basalt/lava_land_surface, /area/overmap_encounter/planetoid/cave/explored) diff --git a/_maps/map_files/generic/CentCom.dmm b/_maps/map_files/generic/CentCom.dmm index dc3ae26b3e20..73f7f051e4fe 100644 --- a/_maps/map_files/generic/CentCom.dmm +++ b/_maps/map_files/generic/CentCom.dmm @@ -2647,7 +2647,7 @@ /obj/item/clothing/suit/armor/tdome/red, /obj/item/clothing/head/helmet/thunderdome, /obj/item/melee/baton/loaded, -/obj/item/melee/transforming/energy/sword/saber/red, +/obj/item/melee/energy/sword/saber/red, /obj/effect/turf_decal/industrial/warning{ dir = 4 }, @@ -3948,7 +3948,7 @@ /obj/item/clothing/suit/armor/tdome/green, /obj/item/clothing/head/helmet/thunderdome, /obj/item/melee/baton/loaded, -/obj/item/melee/transforming/energy/sword/saber/green, +/obj/item/melee/energy/sword/saber/green, /obj/effect/turf_decal/industrial/warning{ dir = 8 }, @@ -6908,7 +6908,7 @@ /obj/effect/turf_decal/corner/opaque/blue{ dir = 8 }, -/obj/item/melee/transforming/energy/ctf, +/obj/item/melee/energy/ctf, /turf/open/floor/plasteel/dark, /area/ctf) "cEn" = ( @@ -7836,7 +7836,7 @@ /obj/effect/turf_decal/corner/opaque/red{ dir = 8 }, -/obj/item/melee/transforming/energy/ctf, +/obj/item/melee/energy/ctf, /turf/open/floor/plasteel/dark, /area/ctf) "eDS" = ( @@ -8387,7 +8387,7 @@ /obj/item/clothing/suit/armor/tdome/green, /obj/item/clothing/head/helmet/thunderdome, /obj/item/melee/baton/loaded, -/obj/item/melee/transforming/energy/sword/saber/green, +/obj/item/melee/energy/sword/saber/green, /obj/effect/turf_decal/industrial/warning{ dir = 8 }, @@ -14402,7 +14402,7 @@ /obj/item/clothing/suit/armor/tdome/red, /obj/item/clothing/head/helmet/thunderdome, /obj/item/melee/baton/loaded, -/obj/item/melee/transforming/energy/sword/saber/red, +/obj/item/melee/energy/sword/saber/red, /obj/effect/turf_decal/industrial/warning{ dir = 4 }, diff --git a/_maps/shuttles/pirate/pirate_noderider.dmm b/_maps/shuttles/pirate/pirate_noderider.dmm index 6861f971143f..5af3efbe556d 100644 --- a/_maps/shuttles/pirate/pirate_noderider.dmm +++ b/_maps/shuttles/pirate/pirate_noderider.dmm @@ -1502,7 +1502,7 @@ /obj/item/storage/box/handcuffs, /obj/item/clothing/glasses/meson, /obj/item/megaphone, -/obj/item/melee/transforming/energy/sword/saber/red, +/obj/item/melee/energy/sword/saber/red, /obj/item/pinpointer/crew, /obj/item/clothing/mask/gas/atmos, /obj/item/clothing/mask/whistle, diff --git a/_maps/shuttles/roumain/srm_elder.dmm b/_maps/shuttles/roumain/srm_elder.dmm index 24d00ebde456..fdd49c8d696a 100644 --- a/_maps/shuttles/roumain/srm_elder.dmm +++ b/_maps/shuttles/roumain/srm_elder.dmm @@ -1447,7 +1447,7 @@ /obj/vehicle/ridden/wheelchair{ dir = 4 }, -/obj/item/melee/transforming/cleaving_saw/old, +/obj/item/melee/cleaving_saw/old, /turf/open/floor/ship/dirt/dark, /area/ship/bridge) "rj" = ( diff --git a/code/__DEFINES/dcs/signals/signals.dm b/code/__DEFINES/dcs/signals/signals.dm index 2293c5bf8fd5..ad4c2d32e071 100644 --- a/code/__DEFINES/dcs/signals/signals.dm +++ b/code/__DEFINES/dcs/signals/signals.dm @@ -668,12 +668,6 @@ #define COMSIG_TRY_STORAGE_RETURN_INVENTORY "storage_return_inventory" //(list/list_to_inject_results_into, recursively_search_inside_storages = TRUE) #define COMSIG_TRY_STORAGE_CAN_INSERT "storage_can_equip" //(obj/item/insertion_candidate, mob/user, silent) - returns bool -// /datum/component/two_handed signals -#define COMSIG_TWOHANDED_WIELD "twohanded_wield" //from base of datum/component/two_handed/proc/wield(mob/living/carbon/user): (/mob/user) - #define COMPONENT_TWOHANDED_BLOCK_WIELD 1 -#define COMSIG_TWOHANDED_UNWIELD "twohanded_unwield" //from base of datum/component/two_handed/proc/unwield(mob/living/carbon/user): (/mob/user) - - // /datum/action signals #define COMSIG_ACTION_TRIGGER "action_trigger" //from base of datum/action/proc/Trigger(): (datum/action) #define COMPONENT_ACTION_BLOCK_TRIGGER 1 diff --git a/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_item.dm b/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_item.dm index 1a562b84a4a1..745990bacd9d 100644 --- a/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_item.dm +++ b/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_item.dm @@ -37,6 +37,8 @@ #define COMPONENT_BLOCK_SHARPEN_ALREADY 4 #define COMPONENT_BLOCK_SHARPEN_MAXED 8 +#define COMSIG_ITEM_USE_CELL "item_use_cell" + #define COMSIG_TOOL_IN_USE "tool_in_use" ///from base of [/obj/item/proc/tool_check_callback]: (mob/living/user) #define COMSIG_TOOL_START_USE "tool_start_use" ///from base of [/obj/item/proc/tool_start_check]: (mob/living/user) #define COMSIG_ITEM_DISABLE_EMBED "item_disable_embed" ///from [/obj/item/proc/disableEmbedding]: @@ -66,3 +68,8 @@ #define COMSIG_ITEM_SPLIT_VALUE 1 #define COMSIG_ITEM_SPLIT_PROFIT "item_split_profits" //Called when getting the item's exact ratio for cargo's profit. #define COMSIG_ITEM_SPLIT_PROFIT_DRY "item_split_profits_dry" //Called when getting the item's exact ratio for cargo's profit, without selling the item. + +// /datum/component/two_handed signals +#define COMSIG_TWOHANDED_WIELD "twohanded_wield" //from base of datum/component/two_handed/proc/wield(mob/living/carbon/user): (/mob/user) + #define COMPONENT_TWOHANDED_BLOCK_WIELD 1 +#define COMSIG_TWOHANDED_UNWIELD "twohanded_unwield" //from base of datum/component/two_handed/proc/unwield(mob/living/carbon/user): (/mob/user) diff --git a/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_transform.dm b/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_transform.dm new file mode 100644 index 000000000000..f7c0b4d5f232 --- /dev/null +++ b/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_transform.dm @@ -0,0 +1,12 @@ +// /datum/component/transforming signals + +/// From /datum/component/transforming/proc/on_attack_self(obj/item/source, mob/user): (obj/item/source, mob/user, active) +#define COMSIG_TRANSFORMING_PRE_TRANSFORM "transforming_pre_transform" + /// Return COMPONENT_BLOCK_TRANSFORM to prevent the item from transforming. + #define COMPONENT_BLOCK_TRANSFORM (1<<0) +/// From /datum/component/transforming/proc/do_transform(obj/item/source, mob/user): (obj/item/source, mob/user, active) +#define COMSIG_TRANSFORMING_ON_TRANSFORM "transforming_on_transform" + /// Return COMPONENT_NO_DEFAULT_MESSAGE to prevent the transforming component from displaying the default transform message / sound. + #define COMPONENT_NO_DEFAULT_MESSAGE (1<<0) + +#define COMSIG_ITEM_FORCE_TRANSFORM "item_force_transform" diff --git a/code/__DEFINES/dcs/signals/signals_obj/signals_object.dm b/code/__DEFINES/dcs/signals/signals_obj/signals_object.dm index 136b73ffb3d2..65308310bc31 100644 --- a/code/__DEFINES/dcs/signals/signals_obj/signals_object.dm +++ b/code/__DEFINES/dcs/signals/signals_obj/signals_object.dm @@ -12,3 +12,8 @@ #define COMSIG_OBJ_HIDE "obj_hide" /// from base of [/atom/proc/obj_destruction]: (damage_flag) #define COMSIG_OBJ_DESTRUCTION "obj_destruction" + +/// Sent from /obj/item/update_weight_class(). (old_w_class, new_w_class) +#define COMSIG_ITEM_WEIGHT_CLASS_CHANGED "item_weight_class_changed" +/// Sent from /obj/item/update_weight_class(), to its loc. (obj/item/changed_item, old_w_class, new_w_class) +#define COMSIG_ATOM_CONTENTS_WEIGHT_CLASS_CHANGED "atom_contents_weight_class_changed" diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 6de819c57aa5..a1133d2f0ea2 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -302,6 +302,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_NO_STORAGE_INSERT "no_storage_insert" //cannot be inserted in a storage. #define TRAIT_T_RAY_VISIBLE "t-ray-visible" // Visible on t-ray scanners if the atom/var/level == 1 #define TRAIT_NO_TELEPORT "no-teleport" //you just can't +/// A transforming item that is actively extended / transformed +#define TRAIT_TRANSFORM_ACTIVE "active_transform" #define TRAIT_WIELDED "wielded" //The item is currently being wielded //quirk traits diff --git a/code/datums/components/melee/charged.dm b/code/datums/components/melee/charged.dm new file mode 100644 index 000000000000..2319977a4a0d --- /dev/null +++ b/code/datums/components/melee/charged.dm @@ -0,0 +1,127 @@ +/* + * Charged weapon component. For weapons that swap between states but require a cell for function. + * For example: Stun batons. + * + * Used to easily make an item that can be attack_self'd to gain force or change mode. + * + * Only values passed on initialize will update when the item is activated (except the icon_state). + * The icon_state of the item will swap between "[icon_state]" and "[icon_state]_on". + */ +/datum/component/transforming/charged + var/obj/item/stock_parts/cell/cell + var/allowed_cells + var/preload_cell_type + var/cell_hit_cost + var/can_remove_cell + var/no_cell_icon + +/datum/component/transforming/charged/Initialize( + start_transformed = FALSE, + transform_cooldown_time = 0 SECONDS, + force_on = 0, + throwforce_on = 0, + throw_speed_on = 2, + sharpness_on = NONE, + hitsound_on = 'sound/weapons/blade1.ogg', + w_class_on = WEIGHT_CLASS_BULKY, + list/attack_verb_on, + inhand_icon_change = TRUE, + _allowed_cells = list(), + _preload_cell_type = /obj/item/stock_parts/cell, + _cell_hit_cost = 1000, + _can_remove_cell = FALSE, + _no_cell_icon = FALSE +) + . = ..() + + allowed_cells = _allowed_cells + preload_cell_type = _preload_cell_type + cell_hit_cost = _cell_hit_cost + can_remove_cell = _can_remove_cell + no_cell_icon = _no_cell_icon + + if(preload_cell_type in allowed_cells) + cell = new preload_cell_type(parent) + +/datum/component/transforming/charged/RegisterWithParent() + . = ..() + RegisterSignal(parent, COMSIG_ATOM_SCREWDRIVER_ACT, PROC_REF(on_screwdriver_act)) + RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, PROC_REF(on_attackby)) + RegisterSignal(parent, COMSIG_PARENT_EXAMINE, PROC_REF(on_examine)) + RegisterSignal(parent, COMSIG_ITEM_USE_CELL, PROC_REF(deduct_charge)) + +/datum/component/transforming/charged/Destroy(force, silent) + if(cell) + QDEL_NULL(cell) + . = ..() + +/datum/component/transforming/charged/on_attack_self(obj/item/source, mob/user) + if(cell && cell.charge > cell_hit_cost) + return ..() + else + set_inactive(source) + if(!cell) + to_chat(user, span_warning("[source] does not have a power source!")) + else + to_chat(user, span_warning("[source] is out of charge.")) + +/datum/component/transforming/charged/proc/on_screwdriver_act(obj/item/source, mob/user, obj/item/screwdriver) + if(cell && can_remove_cell) + cell.update_appearance() + cell.forceMove(get_turf(parent)) + cell = null + to_chat(user, span_notice("You remove the cell from [parent].")) + set_inactive(source) + source.update_appearance() + return COMPONENT_CANCEL_ATTACK_CHAIN + +/datum/component/transforming/charged/proc/on_attackby(obj/item/source, obj/item/attacking_item, mob/user, params) + SIGNAL_HANDLER + + if(attacking_item.type in allowed_cells) + var/obj/item/stock_parts/cell/attacking_cell = attacking_item + if(cell) + to_chat(user, span_notice("[parent] already has a cell!")) + else + if(attacking_cell.maxcharge < cell_hit_cost) + to_chat(user, span_notice("[parent] requires a higher capacity cell.")) + return + if(!user.transferItemToLoc(attacking_item, parent)) + return + cell = attacking_item + to_chat(user, span_notice("You install a cell in [parent].")) + source.update_appearance() + return COMPONENT_CANCEL_ATTACK_CHAIN + +/datum/component/transforming/charged/proc/on_examine(obj/item/source, mob/user, list/examine_list) + SIGNAL_HANDLER + + if(cell) + examine_list += span_notice("\The [source] is [round(cell.percent())]% charged.") + else + examine_list += span_warning("\The [source] does not have a power source installed.") + +/datum/component/transforming/charged/proc/deduct_charge(obj/item/source) + SIGNAL_HANDLER + if(cell) + . = cell.use(cell_hit_cost) + if(active && cell.charge < cell_hit_cost) + playsound(src, SFX_SPARKS, 75, TRUE, -1) + set_inactive(source) + +/datum/component/transforming/charged/proc/set_active_state(active_state = -1) + switch(active_state) + //We didnt pass a specific state to set it to so just toggle it + if(-1) + toggle_active(parent) + if(FALSE) + set_inactive(parent) + if(TRUE) + set_active(parent) + +/datum/component/transforming/charged/set_inactive(obj/item/source) + . = ..() + if(!cell) + source.icon_state = "[initial(source.icon_state)]_nocell" + source.item_state = "[initial(source.icon_state)]_nocell" + source.update_appearance() diff --git a/code/datums/components/melee/transforming.dm b/code/datums/components/melee/transforming.dm new file mode 100644 index 000000000000..744d75de34b3 --- /dev/null +++ b/code/datums/components/melee/transforming.dm @@ -0,0 +1,236 @@ +/* + * Transforming weapon component. For weapons that swap between states. + * For example: Energy swords, cleaving saws, switch blades. + * + * Used to easily make an item that can be attack_self'd to gain force or change mode. + * + * Only values passed on initialize will update when the item is activated (except the icon_state). + * The icon_state of the item will swap between "[icon_state]" and "[icon_state]_on". + */ +/datum/component/transforming + /// Whether the weapon is transformed + var/active = FALSE + /// Cooldown on transforming this item back and forth + var/transform_cooldown_time + /// Force of the weapon when active + var/force_on + /// Throwforce of the weapon when active + var/throwforce_on + /// Throw speed of the weapon when active + var/throw_speed_on + /// Weight class of the weapon when active + var/w_class_on + /// The sharpness of the weapon when active + var/sharpness_on + /// Hitsound played when active + var/hitsound_on + /// List of the original attack verbs the item has. + var/list/attack_verb_off + /// List of attack verbs used when the weapon is enabled + var/list/attack_verb_on + /// If we get sharpened with a whetstone, save the bonus here for later use if we un/redeploy + var/sharpened_bonus = 0 + /// Dictate whether we change inhands or not + var/inhand_icon_change = TRUE + /// Cooldown in between transforms + COOLDOWN_DECLARE(transform_cooldown) + +/datum/component/transforming/Initialize( + start_transformed = FALSE, + transform_cooldown_time = 0 SECONDS, + force_on = 0, + throwforce_on = 0, + throw_speed_on = 2, + sharpness_on = NONE, + hitsound_on = 'sound/weapons/blade1.ogg', + w_class_on = WEIGHT_CLASS_BULKY, + list/attack_verb_on, + inhand_icon_change = TRUE, +) + + if(!isitem(parent)) + return COMPONENT_INCOMPATIBLE + + var/obj/item/item_parent = parent + + src.transform_cooldown_time = transform_cooldown_time + src.force_on = force_on + src.throwforce_on = throwforce_on + src.throw_speed_on = throw_speed_on + src.sharpness_on = sharpness_on + src.hitsound_on = hitsound_on + src.w_class_on = w_class_on + src.inhand_icon_change = inhand_icon_change + + if(attack_verb_on) + src.attack_verb_on = attack_verb_on + attack_verb_off = item_parent.attack_verb + + if(start_transformed) + toggle_active(parent) + +/datum/component/transforming/RegisterWithParent() + var/obj/item/item_parent = parent + + RegisterSignal(parent, COMSIG_ITEM_ATTACK_SELF, PROC_REF(on_attack_self)) + RegisterSignal(parent, COMSIG_ITEM_FORCE_TRANSFORM, PROC_REF(force_transform)) + if(item_parent.sharpness || sharpness_on) + RegisterSignal(parent, COMSIG_ITEM_SHARPEN_ACT, PROC_REF(on_sharpen)) + + +/datum/component/transforming/UnregisterFromParent() + UnregisterSignal(parent, list(COMSIG_ITEM_ATTACK_SELF, COMSIG_ITEM_SHARPEN_ACT)) + +/* + * Called on [COMSIG_ITEM_ATTACK_SELF]. + * + * Check if we can transform our weapon, and if so, call [do_transform]. + * Sends signal [COMSIG_TRANSFORMING_PRE_TRANSFORM], and stops the transform action if it returns [COMPONENT_BLOCK_TRANSFORM]. + * + * source - source of the signal, the item being transformed / parent + * user - the mob transforming the weapon + */ +/datum/component/transforming/proc/on_attack_self(obj/item/source, mob/user) + SIGNAL_HANDLER + + if(!COOLDOWN_FINISHED(src, transform_cooldown)) + to_chat(user, span_warning("Wait a bit before trying to use [source] again!")) + return + + if(SEND_SIGNAL(source, COMSIG_TRANSFORMING_PRE_TRANSFORM, user, active) & COMPONENT_BLOCK_TRANSFORM) + return + + if(do_transform(source, user)) + return COMPONENT_CANCEL_ATTACK_CHAIN + +/* + * Transform the weapon into its alternate form, calling [toggle_active]. + * + * Sends signal [COMSIG_TRANSFORMING_ON_TRANSFORM], and calls [default_transform_message] if it does not return [COMPONENT_NO_DEFAULT_MESSAGE]. + * Also starts the [transform_cooldown] if we have a set [transform_cooldown_time]. + * + * source - the item being transformed / parent + * user - the mob transforming the item + * + * returns TRUE. + */ +/datum/component/transforming/proc/do_transform(obj/item/source, mob/user) + toggle_active(source) + if(!(SEND_SIGNAL(source, COMSIG_TRANSFORMING_ON_TRANSFORM, user, active) & COMPONENT_NO_DEFAULT_MESSAGE)) + default_transform_message(source, user) + + if(isnum(transform_cooldown_time)) + COOLDOWN_START(src, transform_cooldown, transform_cooldown_time) + if(user) + source.add_fingerprint(user) + return TRUE + +/* + * The default feedback message and sound effect for an item transforming. + * + * source - the item being transformed / parent + * user - the mob transforming the item + */ +/datum/component/transforming/proc/default_transform_message(obj/item/source, mob/user) + if(user) + source.balloon_alert(user, "[active ? "enabled" : "disabled"] [source]") + playsound(source, 'sound/weapons/batonextend.ogg', 50, TRUE) + +/* + * Toggle active between true and false, and call + * either set_active or set_inactive depending on whichever state is toggled. + * + * source - the item being transformed / parent + */ +/datum/component/transforming/proc/toggle_active(obj/item/source) + active = !active + if(active) + set_active(source) + else + set_inactive(source) + +/* + * Set our transformed item into its active state. + * Updates all the values that were passed from init and the icon_state. + * + * source - the item being transformed / parent + */ +/datum/component/transforming/proc/set_active(obj/item/source) + ADD_TRAIT(source, TRAIT_TRANSFORM_ACTIVE, REF(src)) + if(sharpness_on) + source.sharpness = sharpness_on + if(force_on) + source.force = force_on + (source.sharpness ? sharpened_bonus : 0) + if(throwforce_on) + source.throwforce = throwforce_on + (source.sharpness ? sharpened_bonus : 0) + if(throw_speed_on) + source.throw_speed = throw_speed_on + + if(LAZYLEN(attack_verb_on)) + source.attack_verb = attack_verb_on + + source.hitsound = hitsound_on + source.update_weight_class(w_class_on) + source.icon_state = "[source.icon_state]_on" + if(inhand_icon_change && source.item_state) + source.item_state = "[source.item_state]_on" + + source.update_appearance() + if(ismob(source.loc)) + var/mob/loc_mob = source.loc + loc_mob.update_inv_hands() + +/* + * Set our transformed item into its inactive state. + * Updates all the values back to the item's initial values. + * + * source - the item being un-transformed / parent + */ +/datum/component/transforming/proc/set_inactive(obj/item/source) + REMOVE_TRAIT(source, TRAIT_TRANSFORM_ACTIVE, REF(src)) + if(sharpness_on) + source.sharpness = initial(source.sharpness) + if(force_on) + source.force = initial(source.force) + (source.sharpness ? sharpened_bonus : 0) + if(throwforce_on) + source.throwforce = initial(source.throwforce) + (source.sharpness ? sharpened_bonus : 0) + if(throw_speed_on) + source.throw_speed = initial(source.throw_speed) + + if(LAZYLEN(attack_verb_off)) + source.attack_verb = attack_verb_off + + source.hitsound = initial(source.hitsound) + source.update_weight_class(initial(source.w_class)) + source.icon_state = initial(source.icon_state) + source.item_state = initial(source.item_state) + + source.update_appearance() + if(ismob(source.loc)) + var/mob/loc_mob = source.loc + loc_mob.update_inv_hands() + +/* + * Called on [COMSIG_ITEM_SHARPEN_ACT]. + * We need to track our sharpened bonus here, so we correctly apply and unapply it + * if our item's sharpness state changes from transforming. + * + * source - the item being sharpened / parent + * increment - the amount of force added + * max - the maximum force that the item can be adjusted to. + * + * Does not return naturally [COMPONENT_BLOCK_SHARPEN_APPLIED] as this is only to track our sharpened bonus between transformation. + */ +/datum/component/transforming/proc/on_sharpen(obj/item/source, increment, max) + SIGNAL_HANDLER + + if(sharpened_bonus) + return COMPONENT_BLOCK_SHARPEN_ALREADY + if(force_on + increment > max) + return COMPONENT_BLOCK_SHARPEN_MAXED + sharpened_bonus = increment + +/datum/component/transforming/proc/force_transform(obj/item/source) + if(isnum(transform_cooldown_time)) + COOLDOWN_START(src, transform_cooldown, transform_cooldown_time) + set_inactive(source) diff --git a/code/datums/components/twohanded.dm b/code/datums/components/melee/twohanded.dm similarity index 100% rename from code/datums/components/twohanded.dm rename to code/datums/components/melee/twohanded.dm diff --git a/code/game/MapData/shuttles/srm_elder.dm b/code/game/MapData/shuttles/srm_elder.dm index 97805731ec2f..453767e4394a 100644 --- a/code/game/MapData/shuttles/srm_elder.dm +++ b/code/game/MapData/shuttles/srm_elder.dm @@ -1,15 +1,12 @@ -/obj/item/melee/transforming/cleaving_saw/old +/obj/item/melee/cleaving_saw/old name = "old cleaving saw" desc = "This saw, old and rusted, is still an effective tool at bleeding beasts and monsters." force = 10 - force_on = 15 //force when active + active_force = 15 //force when active throwforce = 15 - throwforce_on = 15 - faction_bonus_force = 5 - nemesis_factions = list("mining", "boss") + active_throwforce = 15 bleed_stacks_per_hit = 1.5 - /obj/structure/closet/secure_closet/medicalsrm name = "hunter doctor closet" desc = "Everything the Hunter Doctor needs to heal the hurting masses." diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 7a1f7a36283a..73629ea1484f 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -1221,7 +1221,7 @@ //Returns an atom's power cell, if it has one. Overload for individual items. /atom/movable/proc/get_cell() - return + return null /atom/movable/proc/can_be_pulled(user, grab_state, force) if(src == user || !isturf(loc)) diff --git a/code/game/gamemodes/clown_ops/clown_weapons.dm b/code/game/gamemodes/clown_ops/clown_weapons.dm index a3226e864aa7..6dceae3a38dd 100644 --- a/code/game/gamemodes/clown_ops/clown_weapons.dm +++ b/code/game/gamemodes/clown_ops/clown_weapons.dm @@ -12,60 +12,59 @@ //BANANIUM SWORD -/obj/item/melee/transforming/energy/sword/bananium +/obj/item/melee/energy/sword/bananium name = "bananium sword" desc = "An elegant weapon, for a more civilized age." force = 0 throwforce = 0 - force_on = 0 - throwforce_on = 0 + active_force = 0 + active_throwforce = 0 hitsound = null attack_verb_on = list("slipped") - clumsy_check = FALSE sharpness = IS_BLUNT sword_color = "yellow" heat = 0 light_color = COLOR_YELLOW var/next_trombone_allowed = 0 -/obj/item/melee/transforming/energy/sword/bananium/Initialize() +/obj/item/melee/energy/sword/bananium/Initialize() . = ..() adjust_slipperiness() /* Adds or removes a slippery component, depending on whether the sword * is active or not. */ -/obj/item/melee/transforming/energy/sword/proc/adjust_slipperiness() - if(active) +/obj/item/melee/energy/sword/proc/adjust_slipperiness() + if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE)) AddComponent(/datum/component/slippery, 60, GALOSHES_DONT_HELP) else qdel(GetComponent(/datum/component/slippery)) -/obj/item/melee/transforming/energy/sword/bananium/attack(mob/living/M, mob/living/user) +/obj/item/melee/energy/sword/bananium/attack(mob/living/M, mob/living/user) ..() - if(active) + if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE)) var/datum/component/slippery/slipper = GetComponent(/datum/component/slippery) slipper.Slip(src, M) -/obj/item/melee/transforming/energy/sword/bananium/throw_impact(atom/hit_atom, throwingdatum) +/obj/item/melee/energy/sword/bananium/throw_impact(atom/hit_atom, throwingdatum) . = ..() - if(active) + if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE)) var/datum/component/slippery/slipper = GetComponent(/datum/component/slippery) slipper.Slip(src, hit_atom) -/obj/item/melee/transforming/energy/sword/bananium/attackby(obj/item/I, mob/living/user, params) - if((world.time > next_trombone_allowed) && istype(I, /obj/item/melee/transforming/energy/sword/bananium)) +/obj/item/melee/energy/sword/bananium/attackby(obj/item/I, mob/living/user, params) + if((world.time > next_trombone_allowed) && istype(I, /obj/item/melee/energy/sword/bananium)) next_trombone_allowed = world.time + 50 to_chat(user, "You slap the two swords together. Sadly, they do not seem to fit!") playsound(src, 'sound/misc/sadtrombone.ogg', 50) return TRUE return ..() -/obj/item/melee/transforming/energy/sword/bananium/transform_weapon(mob/living/user, supress_message_text) +/obj/item/melee/energy/sword/bananium/on_transform(obj/item/source, mob/user, active) . = ..() adjust_slipperiness() -/obj/item/melee/transforming/energy/sword/bananium/ignition_effect(atom/A, mob/user) +/obj/item/melee/energy/sword/bananium/ignition_effect(atom/A, mob/user) return "" //BANANIUM SHIELD diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 1e1718623816..a008822e8f08 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -3,7 +3,7 @@ icon = 'icons/obj/stationobjs.dmi' icon_state = "recharger" base_icon_state = "recharger" - desc = "A charging dock for energy based weaponry." + desc = "A charging dock for energy based weaponry. However someones modified it to work with most things with cells." use_power = IDLE_POWER_USE idle_power_usage = IDLE_DRAW_MINIMAL active_power_usage = ACTIVE_DRAW_LOW @@ -74,7 +74,7 @@ G.play_tool_sound(src) return - var/allowed = is_type_in_typecache(G, allowed_devices) + var/allowed = G.get_cell() if(allowed) if(anchored) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 3f7a43fe317b..46d2634bbe8d 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -523,8 +523,8 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb playsound(src, 'sound/weapons/effects/deflect.ogg', 100) if(!istype(src, /obj/item/shield)) COOLDOWN_START(src, block_cooldown, block_cooldown_time) - return 1 - return 0 + return TRUE + return FALSE /obj/item/proc/talk_into(mob/M, input, channel, spans, datum/language/language, list/message_mods) return ITALICS | REDUCE_RANGE @@ -1204,6 +1204,18 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb /// Whether or not this item can be put into a storage item through attackby /obj/item/proc/attackby_storage_insert(datum/storage, atom/storage_holder, mob/user) return TRUE + +/obj/item/proc/update_weight_class(new_w_class) + if(w_class == new_w_class) + return FALSE + + var/old_w_class = w_class + w_class = new_w_class + SEND_SIGNAL(src, COMSIG_ITEM_WEIGHT_CLASS_CHANGED, old_w_class, new_w_class) + if(!isnull(loc)) + SEND_SIGNAL(loc, COMSIG_ATOM_CONTENTS_WEIGHT_CLASS_CHANGED, src, old_w_class, new_w_class) + return TRUE + /// How many different types of mats will be counted in a bite? #define MAX_MATS_PER_BITE 2 diff --git a/code/game/objects/items/melee/chainsaw.dm b/code/game/objects/items/melee/chainsaw.dm index d179237f8559..f0b7019200f1 100644 --- a/code/game/objects/items/melee/chainsaw.dm +++ b/code/game/objects/items/melee/chainsaw.dm @@ -3,13 +3,13 @@ /obj/item/chainsaw name = "chainsaw" desc = "A versatile power tool. Useful for limbing trees and delimbing humans." - icon_state = "chainsaw_off" + icon_state = "chainsaw" icon = 'icons/obj/weapon/axe.dmi' lefthand_file = 'icons/mob/inhands/weapons/chainsaw_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/chainsaw_righthand.dmi' flags_1 = CONDUCT_1 force = 13 - var/force_on = 24 + var/active_force = 24 w_class = WEIGHT_CLASS_HUGE throwforce = 13 throw_speed = 2 @@ -31,8 +31,8 @@ /obj/item/chainsaw/attack_self(mob/user) on = !on to_chat(user, "As you pull the starting cord dangling from [src], [on ? "it begins to whirr." : "the chain stops moving."]") - force = on ? force_on : initial(force) - throwforce = on ? force_on : initial(force) + force = on ? active_force : initial(force) + throwforce = on ? active_force : initial(force) icon_state = "chainsaw_[on ? "on" : "off"]" var/datum/component/butchering/butchering = src.GetComponent(/datum/component/butchering) butchering.butchering_enabled = on @@ -56,7 +56,7 @@ name = "THE GREAT COMMUNICATOR" desc = "VRRRRRRR!!!" armour_penetration = 100 - force_on = 30 + active_force = 30 /obj/item/chainsaw/doomslayer/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) if(attack_type == PROJECTILE_ATTACK) diff --git a/code/game/objects/items/melee/dualsaber.dm b/code/game/objects/items/melee/dualsaber.dm index 28242c1006a1..1959fa81eaea 100644 --- a/code/game/objects/items/melee/dualsaber.dm +++ b/code/game/objects/items/melee/dualsaber.dm @@ -23,7 +23,7 @@ max_integrity = 200 armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 70) resistance_flags = FIRE_PROOF - var/w_class_on = WEIGHT_CLASS_BULKY + var/active_w_class = WEIGHT_CLASS_BULKY var/saber_color = "green" var/two_hand_force = 34 var/hacked = FALSE @@ -43,7 +43,7 @@ to_chat(user, "You lack the grace to wield this!") return COMPONENT_TWOHANDED_BLOCK_WIELD sharpness = IS_SHARP - w_class = w_class_on + w_class = active_w_class hitsound = 'sound/weapons/blade1.ogg' START_PROCESSING(SSobj, src) set_light_on(TRUE) @@ -128,7 +128,7 @@ return 1 /obj/item/dualsaber/ignition_effect(atom/A, mob/user) - // same as /obj/item/melee/transforming/energy, mostly + // same as /obj/item/melee/energy, mostly if(!HAS_TRAIT(src, TRAIT_WIELDED)) return "" var/in_mouth = "" diff --git a/code/game/objects/items/melee/energy.dm b/code/game/objects/items/melee/energy.dm index 34219662e53d..1985c3d7ebfa 100644 --- a/code/game/objects/items/melee/energy.dm +++ b/code/game/objects/items/melee/energy.dm @@ -1,7 +1,9 @@ -/obj/item/melee/transforming/energy +/obj/item/melee/energy + sharpness = IS_SHARP + w_class = WEIGHT_CLASS_SMALL + attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") icon = 'icons/obj/weapon/energy.dmi' - hitsound_on = 'sound/weapons/blade1.ogg' - heat = 3500 + heat = 0 max_integrity = 200 armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 30) resistance_flags = FIRE_PROOF @@ -10,42 +12,81 @@ light_power = 1 light_on = FALSE var/sword_color - -/obj/item/melee/transforming/energy/Initialize() + /// The heat given off when active. + var/active_heat = 3500 + + /// Force while active. + var/active_force = 30 + /// Throwforce while active. + var/active_throwforce = 20 + /// Sharpness while active. + var/active_sharpness = IS_SHARP + /// Hitsound played attacking while active. + var/active_hitsound = 'sound/weapons/blade1.ogg' + /// Weight class while active. + var/active_w_class = WEIGHT_CLASS_BULKY + + var/list/attack_verb_on = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") + +/obj/item/melee/energy/Initialize(mapload) . = ..() - if(active) + AddComponent( \ + /datum/component/transforming, \ + force_on = active_force, \ + throwforce_on = active_throwforce, \ + throw_speed_on = 4, \ + sharpness_on = active_sharpness, \ + hitsound_on = active_hitsound, \ + w_class_on = active_w_class, \ + attack_verb_on = attack_verb_on, \ + ) + RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform)) + AddElement(/datum/element/update_icon_updates_onmob) + if(sharpness) + AddComponent(/datum/component/butchering, 50, 100, 0, hitsound) + if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE)) START_PROCESSING(SSobj, src) -/obj/item/melee/transforming/energy/Destroy() +/obj/item/melee/energy/Destroy() STOP_PROCESSING(SSobj, src) return ..() -/obj/item/melee/transforming/energy/add_blood_DNA(list/blood_dna) - return FALSE +/obj/item/melee/energy/proc/on_transform(obj/item/source, mob/user, active) + SIGNAL_HANDLER -/obj/item/melee/transforming/energy/get_sharpness() - return active * sharpness + if(active) + heat = active_heat + START_PROCESSING(SSobj, src) + if(sword_color) + icon_state = "[base_icon_state][sword_color]" + else + heat = initial(heat) + STOP_PROCESSING(SSobj, src) -/obj/item/melee/transforming/energy/process() - open_flame() + tool_behaviour = (active ? TOOL_SAW : NONE) //Lets energy weapons cut trees. Also lets them do bonecutting surgery, which is kinda metal! + if(user) + balloon_alert(user, "[name] [active ? "enabled":"disabled"]") + playsound(src, active ? 'sound/weapons/saberon.ogg' : 'sound/weapons/saberoff.ogg', 35, TRUE) + set_light_on(active) + update_appearance(UPDATE_ICON_STATE) -/obj/item/melee/transforming/energy/transform_weapon(mob/living/user, supress_message_text) - . = ..() - if(.) - if(active) - if(sword_color) - icon_state = "[base_icon_state][sword_color]" - START_PROCESSING(SSobj, src) - else - STOP_PROCESSING(SSobj, src) - set_light_on(active) + return COMPONENT_NO_DEFAULT_MESSAGE + +/obj/item/melee/energy/add_blood_DNA(list/blood_dna) + return FALSE + +/obj/item/melee/energy/get_sharpness() + return sharpness +/obj/item/melee/energy/process(seconds_per_tick) + if(heat) + open_flame() -/obj/item/melee/transforming/energy/get_temperature() - return active * heat +/obj/item/melee/energy/get_temperature() + return heat -/obj/item/melee/transforming/energy/ignition_effect(atom/A, mob/user) - if(!active) +/obj/item/melee/energy/ignition_effect(atom/A, mob/user) + if(!HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE)) return "" var/in_mouth = "" @@ -57,28 +98,28 @@ playsound(loc, hitsound, get_clamped_volume(), TRUE, -1) add_fingerprint(user) -/obj/item/melee/transforming/energy/axe +/obj/item/melee/energy/axe name = "energy axe" desc = "An energized battle axe." - icon_state = "axe0" + icon_state = "axe" lefthand_file = 'icons/mob/inhands/weapons/axes_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/axes_righthand.dmi' force = 40 - force_on = 150 + active_force = 150 throwforce = 25 - throwforce_on = 30 + active_throwforce = 30 hitsound = 'sound/weapons/bladeslice.ogg' throw_speed = 3 throw_range = 5 w_class = WEIGHT_CLASS_NORMAL - w_class_on = WEIGHT_CLASS_HUGE + active_w_class = WEIGHT_CLASS_HUGE flags_1 = CONDUCT_1 armour_penetration = 100 - attack_verb_off = list("attacked", "chopped", "cleaved", "torn", "cut") + attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut") attack_verb_on = list() light_color = LIGHT_COLOR_LIGHT_CYAN -/obj/item/melee/transforming/energy/sword +/obj/item/melee/energy/sword name = "energy sword" desc = "For when a katana isn't enough. While Nanotrasen and the Syndicate both produce the so-called e-swords, they are visually and functionaly identical." icon_state = "sword" @@ -88,7 +129,7 @@ force = 3 throwforce = 5 hitsound = "swing_hit" //it starts deactivated - attack_verb_off = list("tapped", "poked") + attack_verb = list("tapped", "poked") throw_speed = 3 throw_range = 5 sharpness = IS_SHARP @@ -96,38 +137,32 @@ armour_penetration = 35 block_chance = 50 -/obj/item/melee/transforming/energy/sword/transform_weapon(mob/living/user, supress_message_text) - . = ..() - if(. && active && sword_color) - icon_state = "[base_icon_state][sword_color]" - -/obj/item/melee/transforming/energy/sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) - if(active) +/obj/item/melee/energy/sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) + if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE)) return ..() return 0 -/obj/item/melee/transforming/energy/sword/cyborg +/obj/item/melee/energy/sword/cyborg sword_color = "red" var/hitcost = 50 -/obj/item/melee/transforming/energy/sword/cyborg/attack(mob/M, mob/living/silicon/robot/R) +/obj/item/melee/energy/sword/cyborg/attack(mob/M, mob/living/silicon/robot/R) if(R.cell) var/obj/item/stock_parts/cell/C = R.cell - if(active && !(C.use(hitcost))) + if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE) && !(C.use(hitcost))) attack_self(R) to_chat(R, "It's out of charge!") return return ..() -/obj/item/melee/transforming/energy/sword/cyborg/saw //Used by medical Syndicate cyborgs +/obj/item/melee/energy/sword/cyborg/saw //Used by medical Syndicate cyborgs name = "energy saw" desc = "For heavy duty cutting. It has a carbon-fiber blade in addition to a toggleable hard-light edge to dramatically increase sharpness." - force_on = 30 + active_force = 30 force = 18 //About as much as a spear hitsound = 'sound/weapons/circsawhit.ogg' icon = 'icons/obj/surgery.dmi' - icon_state = "esaw_0" - icon_state_on = "esaw_1" + icon_state = "esaw" sword_color = null //stops icon from breaking when turned on. hitcost = 75 //Costs more than a standard cyborg esword w_class = WEIGHT_CLASS_NORMAL @@ -136,54 +171,49 @@ tool_behaviour = TOOL_SAW toolspeed = 0.7 //faster as a saw -/obj/item/melee/transforming/energy/sword/cyborg/saw/cyborg_unequip(mob/user) - if(!active) - return - transform_weapon(user, TRUE) - -/obj/item/melee/transforming/energy/sword/cyborg/saw/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) - return 0 +/obj/item/melee/energy/sword/cyborg/saw/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) + return FALSE -/obj/item/melee/transforming/energy/sword/saber +/obj/item/melee/energy/sword/saber var/list/possible_colors = list("red" = COLOR_SOFT_RED, "blue" = LIGHT_COLOR_LIGHT_CYAN, "green" = LIGHT_COLOR_GREEN, "purple" = LIGHT_COLOR_LAVENDER, "yellow" = COLOR_YELLOW) var/hacked = FALSE -/obj/item/melee/transforming/energy/sword/saber/Initialize(mapload) +/obj/item/melee/energy/sword/saber/Initialize(mapload) . = ..() if(LAZYLEN(possible_colors)) var/set_color = pick(possible_colors) sword_color = set_color set_light_color(possible_colors[set_color]) -/obj/item/melee/transforming/energy/sword/saber/process() +/obj/item/melee/energy/sword/saber/process() . = ..() if(hacked) var/set_color = pick(possible_colors) set_light_color(possible_colors[set_color]) -/obj/item/melee/transforming/energy/sword/saber/red +/obj/item/melee/energy/sword/saber/red possible_colors = list("red" = COLOR_SOFT_RED) -/obj/item/melee/transforming/energy/sword/saber/blue +/obj/item/melee/energy/sword/saber/blue possible_colors = list("blue" = LIGHT_COLOR_LIGHT_CYAN) -/obj/item/melee/transforming/energy/sword/saber/green +/obj/item/melee/energy/sword/saber/green possible_colors = list("green" = LIGHT_COLOR_GREEN) -/obj/item/melee/transforming/energy/sword/saber/purple +/obj/item/melee/energy/sword/saber/purple possible_colors = list("purple" = LIGHT_COLOR_LAVENDER) -/obj/item/melee/transforming/energy/sword/saber/yellow +/obj/item/melee/energy/sword/saber/yellow possible_colors = list("yellow" = COLOR_YELLOW) -/obj/item/melee/transforming/energy/sword/saber/attackby(obj/item/W, mob/living/user, params) +/obj/item/melee/energy/sword/saber/attackby(obj/item/W, mob/living/user, params) if(W.tool_behaviour == TOOL_MULTITOOL) if(!hacked) hacked = TRUE sword_color = "rainbow" to_chat(user, "RNBW_ENGAGE") - if(active) + if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE)) icon_state = "[base_icon_state]rainbow" user.update_inv_hands() else @@ -192,39 +222,38 @@ return ..() -/obj/item/melee/transforming/energy/sword/saber/pirate +/obj/item/melee/energy/sword/saber/pirate name = "energy cutlass" desc = "Arrrr matey." icon_state = "cutlass" base_icon_state = "cutlass" lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi' - icon_state_on = "cutlass" -/obj/item/melee/transforming/energy/sword/saber/pirate/red +/obj/item/melee/energy/sword/saber/pirate/red possible_colors = list("red" = COLOR_SOFT_RED) -/obj/item/melee/transforming/energy/sword/saber/pirate/blue +/obj/item/melee/energy/sword/saber/pirate/blue possible_colors = list("blue" = LIGHT_COLOR_LIGHT_CYAN) -/obj/item/melee/transforming/energy/sword/saber/pirate/green +/obj/item/melee/energy/sword/saber/pirate/green possible_colors = list("green" = LIGHT_COLOR_GREEN) -/obj/item/melee/transforming/energy/sword/saber/pirate/purple +/obj/item/melee/energy/sword/saber/pirate/purple possible_colors = list("purple" = LIGHT_COLOR_LAVENDER) -/obj/item/melee/transforming/energy/sword/saber/pirate/yellow +/obj/item/melee/energy/sword/saber/pirate/yellow possible_colors = list("yellow" = COLOR_YELLOW) -/obj/item/melee/transforming/energy/blade +/obj/item/melee/energy/blade name = "energy blade" desc = "A concentrated beam of energy in the shape of a blade. Very stylish... and lethal." - icon_state = "blade" + icon_state = "lightblade" + item_state = "lightblade" lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi' force = 30 //Normal attacks deal esword damage hitsound = 'sound/weapons/blade1.ogg' - active = 1 throwforce = 1 //Throwing or dropping the item deletes it. throw_speed = 3 throw_range = 1 @@ -233,29 +262,29 @@ sharpness = IS_SHARP //Most of the other special functions are handled in their own files. aka special snowflake code so kewl -/obj/item/melee/transforming/energy/blade/Initialize() +/obj/item/melee/energy/blade/Initialize() . = ..() spark_system = new /datum/effect_system/spark_spread() spark_system.set_up(5, 0, src) spark_system.attach(src) -/obj/item/melee/transforming/energy/blade/Destroy() +/obj/item/melee/energy/blade/Destroy() QDEL_NULL(spark_system) return ..() -/obj/item/melee/transforming/energy/blade/transform_weapon(mob/living/user, supress_message_text) +/obj/item/melee/energy/blade/on_transform(obj/item/source, mob/user, active) return -/obj/item/melee/transforming/energy/blade/hardlight +/obj/item/melee/energy/blade/hardlight name = "hardlight blade" desc = "An extremely sharp blade made out of hard light. Packs quite a punch." icon_state = "lightblade" item_state = "lightblade" -/obj/item/melee/transforming/energy/ctf +/obj/item/melee/energy/ctf name = "energy sword" desc = "That cable over there, I'm going to cut it." - icon_state = "plasmasword0" + icon_state = "plasmasword" lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi' sharpness = IS_SHARP @@ -264,20 +293,19 @@ force = 0 throwforce = 0 hitsound = "swing_hit" //it starts deactivated - attack_verb_off = list("tapped", "poked") + attack_verb = list("tapped", "poked") throw_speed = 3 throw_range = 5 - force_on = 200 //instakill if shields are down + active_force = 200 //instakill if shields are down -/obj/item/melee/transforming/energy/ctf/transform_weapon(mob/living/user, supress_message_text) +/obj/item/melee/energy/ctf/on_transform(obj/item/source, mob/user, active) . = ..() - if(. && active) - icon_state = "plasmasword1" - -/obj/item/melee/transforming/energy/ctf/solgov - armour_penetration = 40 - force_on = 34 //desword grade, but 0 blocking - -/obj/item/melee/transforming/energy/ctf/transform_messages(mob/living/user, supress_message_text) + if(active) + icon_state = "plasmasword_on" playsound(user, active ? 'sound/weapons/SolGov_sword_arm.ogg' : 'sound/weapons/saberoff.ogg', 35, TRUE) to_chat(user, "[src] [active ? "is now active":"can now be concealed"].") + return COMPONENT_NO_DEFAULT_MESSAGE + +/obj/item/melee/energy/ctf/solgov + armour_penetration = 40 + active_force = 34 //desword grade, but 0 blocking diff --git a/code/game/objects/items/melee/energyhalberd.dm b/code/game/objects/items/melee/energyhalberd.dm index 8ae5cdd96f36..961325d50c16 100644 --- a/code/game/objects/items/melee/energyhalberd.dm +++ b/code/game/objects/items/melee/energyhalberd.dm @@ -26,7 +26,7 @@ max_integrity = 200 armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 70) resistance_flags = FIRE_PROOF - var/w_class_on = WEIGHT_CLASS_BULKY + var/active_w_class = WEIGHT_CLASS_BULKY var/halberd_color = "green" var/two_hand_force = 34 var/hacked = FALSE @@ -46,7 +46,7 @@ to_chat(user, "You lack the grace to wield this!") return COMPONENT_TWOHANDED_BLOCK_WIELD sharpness = IS_SHARP - w_class = w_class_on + w_class = active_w_class hitsound = 'sound/weapons/blade1.ogg' START_PROCESSING(SSobj, src) set_light_on(TRUE) @@ -129,7 +129,7 @@ return 1 /obj/item/energyhalberd/ignition_effect(atom/A, mob/user) - // same as /obj/item/melee/transforming/energy, mostly + // same as /obj/item/melee/energy, mostly if(!HAS_TRAIT(src, TRAIT_WIELDED)) return "" var/in_mouth = "" diff --git a/code/game/objects/items/melee/fireaxe.dm b/code/game/objects/items/melee/fireaxe.dm index b3e04ac1bc3c..7ae3728803c0 100644 --- a/code/game/objects/items/melee/fireaxe.dm +++ b/code/game/objects/items/melee/fireaxe.dm @@ -17,10 +17,10 @@ /obj/item/melee/axe/ComponentInitialize() . = ..() AddComponent(/datum/component/butchering, 100, 80, 0 , hitsound) //axes are not known for being precision butchering tools - AddComponent(/datum/component/two_handed, force_unwielded=5, force_wielded=24, icon_wielded="[base_icon_state]1") + AddComponent(/datum/component/two_handed, force_unwielded=5, force_wielded=24, icon_wielded="[base_icon_state]_w") -/obj/item/fireaxe/update_icon_state() - icon_state = "[base_icon_state]0" +/obj/item/melee/axe/update_icon_state() + icon_state = "[base_icon_state]" return ..() /obj/item/melee/axe/afterattack(atom/A, mob/user, proximity) @@ -35,13 +35,13 @@ /obj/item/melee/axe/fire // DEM AXES MAN, marker -Agouri name = "fire axe" desc = "Truly, the weapon of a madman. Who would think to fight fire with an axe?" - icon_state = "fireaxe0" + icon_state = "fireaxe" base_icon_state = "fireaxe" /obj/item/melee/axe/bone // Blatant imitation of the fireaxe, but made out of bone. name = "bone axe" desc = "A large, vicious axe crafted out of several sharpened bone plates and crudely tied together. Made of monsters, by killing monsters, for killing monsters." - icon_state = "bone_axe0" + icon_state = "bone_axe" base_icon_state = "bone_axe" /obj/item/melee/axe/scrap @@ -51,4 +51,4 @@ /obj/item/melee/axe/scrap/ComponentInitialize() . = ..() - AddComponent(/datum/component/two_handed, force_unwielded=5, force_wielded=22, icon_wielded="[base_icon_state]1") + AddComponent(/datum/component/two_handed, force_unwielded=5, force_wielded=22, icon_wielded="[base_icon_state]_w") diff --git a/code/game/objects/items/melee/knife.dm b/code/game/objects/items/melee/knife.dm index c0518a9ffa4e..70ada48ed452 100644 --- a/code/game/objects/items/melee/knife.dm +++ b/code/game/objects/items/melee/knife.dm @@ -21,7 +21,6 @@ item_flags = EYE_STAB tool_behaviour = TOOL_KNIFE - /obj/item/melee/knife/ComponentInitialize() . = ..() set_butchering() @@ -166,6 +165,7 @@ flags_1 = CONDUCT_1 force = 3 w_class = WEIGHT_CLASS_SMALL + sharpness = IS_BLUNT throwforce = 5 throw_speed = 3 throw_range = 6 @@ -173,27 +173,19 @@ hitsound = 'sound/weapons/genhit.ogg' attack_verb = list("stubbed", "poked") resistance_flags = FIRE_PROOF - var/extended = 0 - -/obj/item/melee/knife/switchblade/attack_self(mob/user) - extended = !extended - playsound(src.loc, 'sound/weapons/batonextend.ogg', 50, TRUE) - if(extended) - force = 20 - w_class = WEIGHT_CLASS_NORMAL - throwforce = 23 - icon_state = "switchblade_ext" - attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") - hitsound = 'sound/weapons/bladeslice.ogg' - sharpness = IS_SHARP - else - force = 3 - w_class = WEIGHT_CLASS_SMALL - throwforce = 5 - icon_state = "switchblade" - attack_verb = list("stubbed", "poked") - hitsound = 'sound/weapons/genhit.ogg' - sharpness = IS_BLUNT + +/obj/item/melee/knife/switchblade/ComponentInitialize() + . = ..() + AddComponent( \ + /datum/component/transforming, \ + force_on = 20, \ + throwforce_on = 23, \ + throw_speed_on = 4, \ + sharpness_on = IS_SHARP, \ + hitsound_on = 'sound/weapons/bladeslice.ogg', \ + w_class_on = WEIGHT_CLASS_NORMAL, \ + attack_verb_on = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut"), \ + ) /obj/item/melee/knife/letter_opener name = "letter opener" diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index afb4bfe2ec33..13d4ac99fe18 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -5,11 +5,7 @@ righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi' var/projectile_block_chance = 0 -/obj/item/melee/sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) - if(attack_type == PROJECTILE_ATTACK) - final_block_chance = projectile_block_chance //Don't bring a sword to a gunfight - return ..() - +//cruft /obj/item/melee/proc/check_martial_counter(mob/living/carbon/human/target, mob/living/carbon/human/user) if(target.check_block()) target.visible_message("[target.name] blocks [src] and twists [user]'s arm behind [user.p_their()] back!", @@ -17,6 +13,12 @@ user.Stun(40) return TRUE +//This is only pathed here because there is currently only melee using it, the second you want to add charged to something just make it /obj/item/get_cell() +/obj/item/melee/get_cell() + var/datum/component/transforming/charged/charged_comp = GetComponent(/datum/component/transforming/charged) + if(charged_comp) + return charged_comp.cell + /obj/item/melee/chainofcommand name = "chain of command" desc = "A tool used by great men to placate the frothing masses." @@ -101,8 +103,8 @@ attack_verb = list("beat", "smacked") custom_materials = list(/datum/material/wood = MINERAL_MATERIAL_AMOUNT * 3.5) w_class = WEIGHT_CLASS_HUGE - var/homerun_ready = 0 - var/homerun_able = 0 + var/homerun_ready = FALSE + var/homerun_able = FALSE /obj/item/melee/baseball_bat/homerun name = "home run bat" diff --git a/code/game/objects/items/melee/spear.dm b/code/game/objects/items/melee/spear.dm index 218638882bfb..4a7b8b789dc1 100644 --- a/code/game/objects/items/melee/spear.dm +++ b/code/game/objects/items/melee/spear.dm @@ -1,6 +1,6 @@ //spears /obj/item/melee/spear - icon_state = "spearglass0" + icon_state = "spearglass" icon = 'icons/obj/weapon/spear.dmi' lefthand_file = 'icons/mob/inhands/weapons/polearms_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/polearms_righthand.dmi' @@ -26,10 +26,10 @@ . = ..() AddComponent(/datum/component/butchering, 100, 70) //decent in a pinch, but pretty bad. AddComponent(/datum/component/jousting) - AddComponent(/datum/component/two_handed, force_unwielded=10, force_wielded=18, icon_wielded="[icon_prefix]1") + AddComponent(/datum/component/two_handed, force_unwielded=10, force_wielded=18, icon_wielded="[icon_prefix]_w") /obj/item/melee/spear/update_icon_state() - icon_state = "[icon_prefix]0" + icon_state = "[icon_prefix]" return ..() /obj/item/melee/spear/CheckParts(list/parts_list) @@ -37,7 +37,7 @@ if (istype(tip, /obj/item/shard/plasma)) throwforce = 21 icon_prefix = "spearplasma" - AddComponent(/datum/component/two_handed, force_unwielded=11, force_wielded=19, icon_wielded="[icon_prefix]1") + AddComponent(/datum/component/two_handed, force_unwielded=11, force_wielded=19, icon_wielded="[icon_prefix]_w") update_appearance() qdel(tip) ..() @@ -46,9 +46,9 @@ * Bone Spear */ /obj/item/melee/spear/bone //Blatant imitation of spear, but made out of bone. Not valid for explosive modification. - icon_state = "bone_spear0" + icon_state = "bone_spear" name = "bone spear" - base_icon_state = "bone_spear0" + base_icon_state = "bone_spear" icon_prefix = "bone_spear" desc = "A haphazardly-constructed yet still deadly weapon. The pinnacle of modern technology." //this should be a plasma spear or worse. @@ -57,11 +57,11 @@ /obj/item/melee/spear/bone/ComponentInitialize() . = ..() - AddComponent(/datum/component/two_handed, force_unwielded=11, force_wielded=19, icon_wielded="[icon_prefix]1") + AddComponent(/datum/component/two_handed, force_unwielded=11, force_wielded=19, icon_wielded="[icon_prefix]_w") /obj/item/melee/spear/explosive name = "explosive lance" - icon_state = "spearbomb0" + icon_state = "spearbomb" base_icon_state = "spearbomb" icon_prefix = "spearbomb" var/obj/item/grenade/explosive = null @@ -73,7 +73,7 @@ /obj/item/melee/spear/explosive/ComponentInitialize() . = ..() - AddComponent(/datum/component/two_handed, force_unwielded=10, force_wielded=18, icon_wielded="[icon_prefix]1") + AddComponent(/datum/component/two_handed, force_unwielded=10, force_wielded=18, icon_wielded="[icon_prefix]_w") /obj/item/melee/spear/explosive/proc/set_explosive(obj/item/grenade/G) if(explosive) diff --git a/code/game/objects/items/melee/stunbaton.dm b/code/game/objects/items/melee/stunbaton.dm index 05225d80cff8..152bc76d5f80 100644 --- a/code/game/objects/items/melee/stunbaton.dm +++ b/code/game/objects/items/melee/stunbaton.dm @@ -23,7 +23,7 @@ var/can_remove_cell = TRUE var/turned_on = FALSE - var/activate_sound = "sparks" + var/activate_sound = SFX_SPARKS var/attack_cooldown_check = 0 SECONDS var/attack_cooldown = 2.5 SECONDS @@ -99,7 +99,7 @@ /obj/item/melee/baton/update_icon_state() if(turned_on) - icon_state = "[initial(icon_state)]_active" + icon_state = "[initial(icon_state)]_on" return ..() if(!cell) icon_state = "[initial(icon_state)]_nocell" @@ -110,23 +110,23 @@ /obj/item/melee/baton/examine(mob/user) . = ..() if(cell) - . += "\The [src] is [round(cell.percent())]% charged." + . += span_notice("\The [src] is [round(cell.percent())]% charged.") else - . += "\The [src] does not have a power source installed." + . += span_warning("\The [src] does not have a power source installed.") /obj/item/melee/baton/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/stock_parts/cell)) var/obj/item/stock_parts/cell/C = W if(cell) - to_chat(user, "[src] already has a cell!") + to_chat(user, span_notice("[src] already has a cell!")) else if(C.maxcharge < cell_hit_cost) - to_chat(user, "[src] requires a higher capacity cell.") + to_chat(user, span_notice("[src] requires a higher capacity cell.")) return if(!user.transferItemToLoc(W, src)) return cell = W - to_chat(user, "You install a cell in [src].") + to_chat(user, span_notice("You install a cell in [src].")) update_appearance() else if(W.tool_behaviour == TOOL_SCREWDRIVER) @@ -139,7 +139,7 @@ cell.update_appearance() cell.forceMove(get_turf(src)) cell = null - to_chat(user, "You remove the cell from [src].") + to_chat(user, span_notice("You remove the cell from [src].")) turned_on = FALSE update_appearance() @@ -149,22 +149,22 @@ /obj/item/melee/baton/proc/toggle_on(mob/user) if(cell && cell.charge > cell_hit_cost) turned_on = !turned_on - to_chat(user, "[src] is now [turned_on ? "on" : "off"].") + to_chat(user, span_notice("[src] is now [turned_on ? "on" : "off"].")) playsound(src, activate_sound, 75, TRUE, -1) else turned_on = FALSE if(!cell) - to_chat(user, "[src] does not have a power source!") + to_chat(user, span_warning("[src] does not have a power source!")) else - to_chat(user, "[src] is out of charge.") + to_chat(user, span_warning("[src] is out of charge.")) update_appearance() add_fingerprint(user) /obj/item/melee/baton/proc/clumsy_check(mob/living/carbon/human/user) if(turned_on && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)) playsound(src, stun_sound, 75, TRUE, -1) - user.visible_message("[user] accidentally hits [user.p_them()]self with [src]!", \ - "You accidentally hit yourself with [src]!") + user.visible_message(span_danger("[user] accidentally hits [user.p_them()]self with [src]!"), \ + span_userdanger("You accidentally hit yourself with [src]!")) user.Knockdown(stun_time*3) //should really be an equivalent to attack(user,user) deductcharge(cell_hit_cost) return TRUE @@ -191,10 +191,10 @@ user.do_attack_animation(M) return else - to_chat(user, "The baton is still charging!") + to_chat(user, span_danger("The [src] is still charging!")) else - M.visible_message("[user] prods [M] with [src]. Luckily it was off.", \ - "[user] prods you with [src]. Luckily it was off.") + M.visible_message(span_warning("[user] prods [M] with [src]. Luckily it was off."), \ + span_warning("[user] prods you with [src]. Luckily it was off.")) else if(turned_on) if(attack_cooldown_check <= world.time) @@ -206,7 +206,7 @@ if(shields_blocked(L, user)) return FALSE if(HAS_TRAIT_FROM(L, TRAIT_IWASBATONED, user)) //no doublebaton abuse anon! - to_chat(user, "[L] manages to avoid the attack!") + to_chat(user, span_danger("[L] manages to avoid the attack!")) return FALSE if(iscyborg(loc)) var/mob/living/silicon/robot/R = loc @@ -228,8 +228,8 @@ if(user) L.lastattacker = user.real_name L.lastattackerckey = user.ckey - L.visible_message("[user] stuns [L] with [src]!", \ - "[user] stuns you with [src]!") + L.visible_message(span_danger("[user] stuns [L] with [src]!"), \ + span_userdanger("[user] stuns you with [src]!")) log_combat(user, L, "stunned") playsound(src, stun_sound, 50, TRUE, -1) @@ -245,7 +245,7 @@ /obj/item/melee/baton/proc/apply_stun_effect_end(mob/living/target) var/trait_check = HAS_TRAIT(target, TRAIT_STUNRESISTANCE) //var since we check it in out to_chat as well as determine stun duration if(!target.IsKnockdown()) - to_chat(target, "Your muscles seize, making you collapse[trait_check ? ", but your body quickly recovers..." : "!"]") + to_chat(target, span_warning("Your muscles seize, making you collapse[trait_check ? ", but your body quickly recovers..." : "!"]")) if(trait_check) target.Knockdown(stun_time * 0.1) @@ -361,7 +361,7 @@ var/on_icon_state // What is our sprite when turned on var/off_icon_state // What is our sprite when turned off var/on_item_state // What is our in-hand sprite when turned on - var/force_on // Damage when on - not stunning + var/active_force // Damage when on - not stunning var/force_off // Damage when off - not stunning var/weight_class_on // What is the new size class when turned on @@ -373,8 +373,8 @@ /obj/item/melee/classic_baton/proc/get_on_description() . = list() - .["local_on"] = "You extend the baton." - .["local_off"] = "You collapse the baton." + .["local_on"] = span_warning("You extend the baton.") + .["local_off"] = span_notice("You collapse the baton.") return . @@ -382,8 +382,8 @@ /obj/item/melee/classic_baton/proc/get_stun_description(mob/living/target, mob/living/user) . = list() - .["visible"] = "[user] knocks [target] down with [src]!" - .["local"] = "[user] knocks you down with [src]!" + .["visible"] = span_danger("[user] knocks [target] down with [src]!") + .["local"] = span_userdanger("[user] knocks you down with [src]!") return . @@ -391,8 +391,8 @@ /obj/item/melee/classic_baton/proc/get_silicon_stun_description(mob/living/target, mob/living/user) . = list() - .["visible"] = "[user] pulses [target]'s sensors with the baton!" - .["local"] = "You pulse [target]'s sensors with the baton!" + .["visible"] = span_danger("[user] pulses [target]'s sensors with the baton!") + .["local"] = span_danger("You pulse [target]'s sensors with the baton!") return . @@ -410,7 +410,7 @@ add_fingerprint(user) if((HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50)) - to_chat(user, "You hit yourself over the head!") + to_chat(user, span_userdanger("You hit yourself over the head!")) user.Paralyze(knockdown_time_carbon * force) user.apply_damage(stamina_damage, STAMINA, BODY_ZONE_HEAD) @@ -493,7 +493,7 @@ /obj/item/melee/classic_baton/telescopic name = "telescopic baton" desc = "A compact yet robust personal defense weapon. Can be concealed when folded." - icon_state = "telebaton_0" + icon_state = "telebaton" lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi' item_state = null @@ -504,10 +504,10 @@ on = FALSE on_sound = 'sound/weapons/batonextend.ogg' - on_icon_state = "telebaton_1" - off_icon_state = "telebaton_0" + on_icon_state = "telebaton_on" + off_icon_state = "telebaton" on_item_state = "nullrod" - force_on = 10 + active_force = 10 force_off = 0 weight_class_on = WEIGHT_CLASS_BULKY @@ -520,7 +520,7 @@ icon_state = on_icon_state item_state = on_item_state w_class = weight_class_on - force = force_on + force = active_force attack_verb = list("smacked", "struck", "cracked", "beaten") else to_chat(user, desc["local_off"]) @@ -537,7 +537,7 @@ /obj/item/melee/classic_baton/telescopic/contractor_baton name = "contractor baton" desc = "A compact, specialised baton assigned to Syndicate contractors. Applies light electrical shocks to targets." - icon_state = "contractor_baton_0" + icon_state = "contractor_baton" item_state = null slot_flags = ITEM_SLOT_BELT w_class = WEIGHT_CLASS_SMALL @@ -550,15 +550,15 @@ on_sound = 'sound/weapons/contractorbatonextend.ogg' on_stun_sound = 'sound/effects/contractorbatonhit.ogg' - on_icon_state = "contractor_baton_1" - off_icon_state = "contractor_baton_0" + on_icon_state = "contractor_baton_on" + off_icon_state = "contractor_baton" on_item_state = "contractor_baton" - force_on = 16 + active_force = 16 force_off = 5 weight_class_on = WEIGHT_CLASS_NORMAL /obj/item/melee/classic_baton/telescopic/contractor_baton/get_wait_description() - return "The baton is still charging!" + return span_danger("The baton is still charging!") /obj/item/melee/classic_baton/telescopic/contractor_baton/additional_effects_carbon(mob/living/target, mob/living/user) target.Jitter(20) diff --git a/code/game/objects/items/melee/sword.dm b/code/game/objects/items/melee/sword.dm index e74dd456b466..0b64e22ed67c 100644 --- a/code/game/objects/items/melee/sword.dm +++ b/code/game/objects/items/melee/sword.dm @@ -8,13 +8,22 @@ flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_BACK w_class = WEIGHT_CLASS_BULKY - obj_flags = UNIQUE_RENAME - block_chance = 25 + block_chance = 10 attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") sharpness = IS_SHARP armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 50) resistance_flags = FIRE_PROOF +/obj/item/melee/sword/ComponentInitialize() + . = ..() + AddComponent(/datum/component/butchering, 30, 95, 5) //fast and effective, but as a sword, it might damage the results. + +//cruft +/obj/item/melee/sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) + if(attack_type == PROJECTILE_ATTACK) + final_block_chance = projectile_block_chance //Don't bring a sword to a gunfight + return ..() + /obj/item/melee/sword/claymore name = "claymore" desc = "What are you standing around staring at this for? Get to killing!" @@ -41,7 +50,7 @@ /obj/item/melee/sword/scrap name = "scrap sword" desc = "A jagged and painful weapon only effective on targets without an armour" - icon_state = "machete0" + icon_state = "machete" force = 24 throwforce = 10 armour_penetration = -35 @@ -50,7 +59,7 @@ /obj/item/melee/sword/mass name = "mass produced machete" desc = "A middle ground between a machete and a short sword. A simple construction of stamped steel but its so cheap its hard to complain. Its right between being a one hand and two handed weapon" - icon_state = "machete0" + icon_state = "machete" base_icon_state = "machete" force = 20 throwforce = 15 @@ -75,8 +84,8 @@ /obj/item/melee/sword/chainsaw name = "sacred chainsaw sword" desc = "Suffer not a heretic to live." - icon_state = "chainswordon" - item_state = "chainswordon" + icon_state = "chainsword_on" + item_state = "chainsword_on" force = 15 throwforce = 10 armour_penetration = 25 @@ -99,10 +108,6 @@ hitsound = 'sound/weapons/rapierhit.ogg' custom_materials = list(/datum/material/iron = 1000) -/obj/item/melee/sword/sabre/Initialize() - . = ..() - AddComponent(/datum/component/butchering, 30, 95, 5) //fast and effective, but as a sword, it might damage the results. - /obj/item/melee/sword/sabre/on_enter_storage(datum/component/storage/concrete/S) var/obj/item/storage/belt/sabre/B = S.real_location() if(istype(B)) @@ -152,50 +157,30 @@ w_class = WEIGHT_CLASS_SMALL attack_verb = list("smacked", "prodded") - var/extended = FALSE var/extend_sound = 'sound/weapons/batonextend.ogg' - var/on_icon_state = "suns-tsword_ext" - var/on_item_state = "suns-tsword_ext" - var/off_icon_state = "suns-tsword" - var/off_item_state = "suns-tsword" - - var/force_on = 10 - var/on_throwforce = 10 - var/on_blockchance = 40 - - var/force_off = 0 - var/off_throwforce = 0 - var/off_blockchance = 0 - - var/weight_class_on = WEIGHT_CLASS_BULKY - -/obj/item/melee/sword/sabre/suns/telescopic/attack_self(mob/user) - extended = !extended - - if(extended) - to_chat(user, "You extend the [src].") - icon_state = on_icon_state - item_state = on_item_state - slot_flags = 0 - w_class = weight_class_on - force = force_on - throwforce = on_throwforce - block_chance = on_blockchance - attack_verb = list("slashed", "cut") + var/on_block_chance = 40 + +/obj/item/melee/sword/sabre/suns/telescopic/ComponentInitialize() + . = ..() + AddComponent( \ + /datum/component/transforming, \ + force_on = 10, \ + throwforce_on = 10, \ + attack_verb_on = list("slashed", "cut"), \ + w_class_on = WEIGHT_CLASS_BULKY, \ + ) + RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform)) + +/obj/item/melee/sword/sabre/suns/telescopic/proc/on_transform(obj/item/source, mob/user, active) + SIGNAL_HANDLER + + if(active) + block_chance = on_block_chance else - to_chat(user, "You collapse the [src].") - icon_state = off_icon_state - item_state = off_item_state - slot_flags = ITEM_SLOT_BELT - w_class = WEIGHT_CLASS_SMALL - force = force_off - throwforce = off_throwforce - block_chance = off_blockchance - attack_verb = list("smacked", "prodded") - - playsound(get_turf(src), extend_sound, 50, TRUE) - add_fingerprint(user) + block_chance = initial(block_chance) + playsound(user, extend_sound, 50, TRUE) + return COMPONENT_NO_DEFAULT_MESSAGE /obj/item/melee/sword/supermatter name = "supermatter sword" @@ -324,7 +309,7 @@ //HF blade /obj/item/melee/sword/vibro - icon_state = "hfrequency0" + icon_state = "hfrequency" base_icon_state = "hfrequency" lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi' diff --git a/code/game/objects/items/melee/transforming.dm b/code/game/objects/items/melee/transforming.dm deleted file mode 100644 index 8059e021b8f0..000000000000 --- a/code/game/objects/items/melee/transforming.dm +++ /dev/null @@ -1,88 +0,0 @@ -/obj/item/melee/transforming - sharpness = IS_SHARP - stealthy_audio = TRUE //Most of these are antag weps so we dont want them to be /too/ overt. - var/active = FALSE - var/force_on = 30 //force when active - var/faction_bonus_force = 0 //Bonus force dealt against certain factions - var/throwforce_on = 20 - var/icon_state_on = "axe1" - var/hitsound_on = 'sound/weapons/blade1.ogg' - var/list/attack_verb_on = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") - var/list/attack_verb_off = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") - w_class = WEIGHT_CLASS_SMALL - var/bonus_active = FALSE //If the faction damage bonus is active - var/list/nemesis_factions //Any mob with a faction that exists in this list will take bonus damage/effects - var/w_class_on = WEIGHT_CLASS_BULKY - var/clumsy_check = TRUE - -/obj/item/melee/transforming/Initialize() - . = ..() - if(active) - if(attack_verb_on.len) - attack_verb = attack_verb_on - else - if(attack_verb_off.len) - attack_verb = attack_verb_off - if(embedding) - updateEmbedding() - if(sharpness) - AddComponent(/datum/component/butchering, 50, 100, 0, hitsound) - -/obj/item/melee/transforming/attack_self(mob/living/carbon/user) - if(transform_weapon(user)) - clumsy_transform_effect(user) - -/obj/item/melee/transforming/attack(mob/living/target, mob/living/carbon/human/user) - var/nemesis_faction = FALSE - if(LAZYLEN(nemesis_factions)) - for(var/F in target.faction) - if(F in nemesis_factions) - nemesis_faction = TRUE - force += faction_bonus_force - nemesis_effects(user, target) - break - . = ..() - if(nemesis_faction) - force -= faction_bonus_force - -/obj/item/melee/transforming/proc/transform_weapon(mob/living/user, supress_message_text) - active = !active - if(active) - force = force_on - throwforce = throwforce_on - hitsound = hitsound_on - throw_speed = 4 - if(attack_verb_on.len) - attack_verb = attack_verb_on - icon_state = icon_state_on - w_class = w_class_on - if(embedding) - updateEmbedding() - else - force = initial(force) - throwforce = initial(throwforce) - hitsound = initial(hitsound) - throw_speed = initial(throw_speed) - if(attack_verb_off.len) - attack_verb = attack_verb_off - icon_state = initial(icon_state) - w_class = initial(w_class) - if(embedding) - disableEmbedding() - - transform_messages(user, supress_message_text) - add_fingerprint(user) - return TRUE - -/obj/item/melee/transforming/proc/nemesis_effects(mob/living/user, mob/living/target) - return - -/obj/item/melee/transforming/proc/transform_messages(mob/living/user, supress_message_text) - playsound(user, active ? 'sound/weapons/saberon.ogg' : 'sound/weapons/saberoff.ogg', 35, TRUE) //changed it from 50% volume to 35% because deafness - if(!supress_message_text) - to_chat(user, "[src] [active ? "is now active":"can now be concealed"].") - -/obj/item/melee/transforming/proc/clumsy_transform_effect(mob/living/user) - if(clumsy_check && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)) - to_chat(user, "You accidentally cut yourself with [src], like a doofus!") - user.take_bodypart_damage(5,5) diff --git a/code/game/objects/items/melee/trickweapon.dm b/code/game/objects/items/melee/trickweapon.dm new file mode 100644 index 000000000000..af574085a158 --- /dev/null +++ b/code/game/objects/items/melee/trickweapon.dm @@ -0,0 +1,69 @@ +/obj/item/melee/cleaving_saw + name = "cleaving saw" + desc = "This saw, effective at drawing the blood of beasts, transforms into a long cleaver that makes use of centrifugal force." + force = 12 + var/active_force = 20 //force when active + throwforce = 20 + var/active_throwforce = 20 + icon = 'icons/obj/lavaland/artefacts.dmi' + lefthand_file = 'icons/mob/inhands/64x64_lefthand.dmi' + righthand_file = 'icons/mob/inhands/64x64_righthand.dmi' + inhand_x_dimension = 64 + inhand_y_dimension = 64 + icon_state = "cleaving_saw" + item_state = "cleaving_saw" + slot_flags = ITEM_SLOT_BELT + attack_verb = list("attacked", "sawed", "sliced", "torn", "ripped", "diced", "cut") + hitsound = 'sound/weapons/bladeslice.ogg' + sharpness = IS_SHARP + + var/transform_cooldown + var/swiping = FALSE + var/bleed_stacks_per_hit = 3 + +/obj/item/melee/cleaving_saw/Initialize(mapload) + . = ..() + AddElement(/datum/element/update_icon_updates_onmob) + AddComponent(/datum/component/butchering, 50, 100, 0, hitsound) + AddComponent( \ + /datum/component/transforming, \ + transform_cooldown_time = (CLICK_CD_MELEE * 0.25), \ + force_on = active_force, \ + throwforce_on = active_throwforce, \ + attack_verb_on = list("cleave", "swipe", "slash", "chop"), \ + ) + RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform)) + +/obj/item/melee/cleaving_saw/examine(mob/user) + . = ..() + . += span_notice("It is [HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE) ? "open, will cleave enemies in a wide arc and deal additional damage to fauna":"closed, and can be used for rapid consecutive attacks that cause fauna to bleed"].") + . += span_notice("Both modes will build up existing bleed effects, doing a burst of high damage if the bleed is built up high enough.") + . += span_notice("Transforming it immediately after an attack causes the next attack to come out faster.") + +/obj/item/melee/cleaving_saw/proc/on_transform(obj/item/source, mob/user, active) + SIGNAL_HANDLER + user.changeNext_move(CLICK_CD_MELEE * 0.25) + if(user) + balloon_alert(user, "[active ? "opened" : "closed"] [src]") + playsound(user, 'sound/magic/clockwork/fellowship_armory.ogg', 35, TRUE, frequency = 90000 - (active * 30000)) + return COMPONENT_NO_DEFAULT_MESSAGE + +/obj/item/melee/cleaving_saw/melee_attack_chain(mob/user, atom/target, params) + . = ..() + if(!HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE)) + user.changeNext_move(CLICK_CD_MELEE * 0.5) //when closed, it attacks very rapidly + +/obj/item/melee/cleaving_saw/attack(mob/living/target, mob/living/carbon/human/user) + if(!HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE) || swiping || !target.density || get_turf(target) == get_turf(user)) + ..() + else + var/turf/user_turf = get_turf(user) + var/dir_to_target = get_dir(user_turf, get_turf(target)) + swiping = TRUE + var/static/list/cleaving_saw_cleave_angles = list(0, -45, 45) //so that the animation animates towards the target clicked and not towards a side target + for(var/i in cleaving_saw_cleave_angles) + var/turf/T = get_step(user_turf, turn(dir_to_target, i)) + for(var/mob/living/L in T) + if(user.Adjacent(L) && L.density) + melee_attack_chain(user, L) + swiping = FALSE diff --git a/code/game/objects/items/sharpener.dm b/code/game/objects/items/sharpener.dm index f9d429b55a3e..00217a8550a4 100644 --- a/code/game/objects/items/sharpener.dm +++ b/code/game/objects/items/sharpener.dm @@ -21,7 +21,7 @@ if(requires_sharpness && !I.get_sharpness()) to_chat(user, "You can only sharpen items that are already sharp, such as knives!") return - if(istype(I, /obj/item/melee/transforming/energy)) + if(istype(I, /obj/item/melee/energy)) to_chat(user, "You don't think \the [I] will be the thing getting modified if you use it on \the [src]!") return diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm index 685bfeae8a8a..81484bc4e13e 100644 --- a/code/game/objects/items/shields.dm +++ b/code/game/objects/items/shields.dm @@ -35,7 +35,7 @@ final_block_chance += 30 if(attack_type == LEAP_ATTACK) final_block_chance = 100 - . = ..() + . = .() if(.) on_shield_block(owner, hitby, attack_text, damage, attack_type) diff --git a/code/game/objects/items/storage/uplink_kits.dm b/code/game/objects/items/storage/uplink_kits.dm index 5a1bdaabe340..97f8452e831e 100644 --- a/code/game/objects/items/storage/uplink_kits.dm +++ b/code/game/objects/items/storage/uplink_kits.dm @@ -56,7 +56,7 @@ new /obj/item/encryptionkey/syndicate(src) if("murder") - new /obj/item/melee/transforming/energy/sword/saber(src) + new /obj/item/melee/energy/sword/saber(src) new /obj/item/clothing/glasses/thermal/syndi(src) new /obj/item/card/emag(src) new /obj/item/clothing/shoes/chameleon/noslip(src) @@ -178,7 +178,7 @@ new /obj/item/dnainjector/geladikinesis(src) new /obj/item/dnainjector/cryokinesis(src) new /obj/item/gun/energy/temperature/security(src) - new /obj/item/melee/transforming/energy/sword/saber/blue(src) //see see it fits the theme bc its blue and ice is blue + new /obj/item/melee/energy/sword/saber/blue(src) //see see it fits the theme bc its blue and ice is blue if("made_man") new /obj/effect/spawner/random/clothing/mafia_outfit(src) // 0 TC, just an outfit for the new 'don of this family diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 220e0e605828..3c1ce5b25ada 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -296,7 +296,7 @@ w_class = WEIGHT_CLASS_SMALL add_fingerprint(user) -// Copied from /obj/item/melee/transforming/energy/sword/attackby +// Copied from /obj/item/melee/energy/sword/attackby /obj/item/toy/sword/attackby(obj/item/W, mob/living/user, params) if(istype(W, /obj/item/toy/sword)) if(HAS_TRAIT(W, TRAIT_NODROP) || HAS_TRAIT(src, TRAIT_NODROP)) diff --git a/code/game/objects/structures/crates_lockers/closets/gimmick.dm b/code/game/objects/structures/crates_lockers/closets/gimmick.dm index a69a279bad77..626640f5a607 100644 --- a/code/game/objects/structures/crates_lockers/closets/gimmick.dm +++ b/code/game/objects/structures/crates_lockers/closets/gimmick.dm @@ -55,7 +55,7 @@ for(var/i in 1 to 3) new /obj/item/clothing/suit/armor/tdome/red(src) for(var/i in 1 to 3) - new /obj/item/melee/transforming/energy/sword/saber(src) + new /obj/item/melee/energy/sword/saber(src) for(var/i in 1 to 3) new /obj/item/gun/energy/laser(src) for(var/i in 1 to 3) @@ -74,7 +74,7 @@ for(var/i in 1 to 3) new /obj/item/clothing/suit/armor/tdome/green(src) for(var/i in 1 to 3) - new /obj/item/melee/transforming/energy/sword/saber(src) + new /obj/item/melee/energy/sword/saber(src) for(var/i in 1 to 3) new /obj/item/gun/energy/laser(src) for(var/i in 1 to 3) diff --git a/code/modules/cargo/exports/lavaland.dm b/code/modules/cargo/exports/lavaland.dm index 722333fac2db..ba721f10213f 100644 --- a/code/modules/cargo/exports/lavaland.dm +++ b/code/modules/cargo/exports/lavaland.dm @@ -39,7 +39,7 @@ cost = 40000 unit_name = "major lava planet artifact" export_types = list(/obj/item/hierophant_club, - /obj/item/melee/transforming/cleaving_saw, + /obj/item/melee/cleaving_saw, /obj/item/organ/vocal_cords/colossus, /obj/machinery/anomalous_crystal, /obj/item/mayhem, diff --git a/code/modules/clothing/factions/clip.dm b/code/modules/clothing/factions/clip.dm index c0347e4eff8d..031e000c78c1 100644 --- a/code/modules/clothing/factions/clip.dm +++ b/code/modules/clothing/factions/clip.dm @@ -215,7 +215,7 @@ armor = list("melee" = 50, "bullet" = 50, "laser" = 30, "energy" = 40, "bomb" = 35, "bio" = 100, "rad" = 60, "fire" = 50, "acid" = 80) helmettype = /obj/item/clothing/head/helmet/space/hardsuit/clip_spotter - allowed = list(/obj/item/gun, /obj/item/ammo_box,/obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/transforming/energy/sword/saber, /obj/item/restraints/handcuffs, /obj/item/tank/internals) + allowed = list(/obj/item/gun, /obj/item/ammo_box,/obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/energy/sword/saber, /obj/item/restraints/handcuffs, /obj/item/tank/internals) resistance_flags = null slowdown = 1 diff --git a/code/modules/clothing/outfits/ert/indie_ert.dm b/code/modules/clothing/outfits/ert/indie_ert.dm index 15ac8f718802..57d737ba0f8a 100644 --- a/code/modules/clothing/outfits/ert/indie_ert.dm +++ b/code/modules/clothing/outfits/ert/indie_ert.dm @@ -160,7 +160,7 @@ ears = /obj/item/radio/headset/alt r_hand = /obj/item/gun/energy/pulse - l_pocket = /obj/item/melee/transforming/energy/sword/saber + l_pocket = /obj/item/melee/energy/sword/saber r_pocket = /obj/item/shield/energy diff --git a/code/modules/clothing/outfits/standard.dm b/code/modules/clothing/outfits/standard.dm index 18e220c3f664..3e76c4d88bd1 100644 --- a/code/modules/clothing/outfits/standard.dm +++ b/code/modules/clothing/outfits/standard.dm @@ -113,7 +113,7 @@ box = /obj/item/storage/box/debugtools internals_slot = ITEM_SLOT_SUITSTORE backpack_contents = list( - /obj/item/melee/transforming/energy/axe=1,\ + /obj/item/melee/energy/axe=1,\ /obj/item/storage/part_replacer/bluespace/tier4=1,\ /obj/item/debug/human_spawner=1,\ /obj/item/debug/omnitool=1 diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 25788f4556ae..f806beca1e02 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -411,7 +411,7 @@ item_state = "syndie_hardsuit" hardsuit_type = "syndi" armor = list("melee" = 40, "bullet" = 50, "laser" = 30, "energy" = 40, "bomb" = 35, "bio" = 100, "rad" = 50, "fire" = 50, "acid" = 90) - allowed = list(/obj/item/gun, /obj/item/ammo_box,/obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/transforming/energy/sword/saber, /obj/item/restraints/handcuffs, /obj/item/tank/internals) + allowed = list(/obj/item/gun, /obj/item/ammo_box,/obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/energy/sword/saber, /obj/item/restraints/handcuffs, /obj/item/tank/internals) helmettype = /obj/item/clothing/head/helmet/space/hardsuit/syndi jetpack = /obj/item/tank/jetpack/suit supports_variations = DIGITIGRADE_VARIATION | VOX_VARIATION @@ -917,7 +917,7 @@ item_state = "syndie_hardsuit" hardsuit_type = "syndi" armor = list("melee" = 40, "bullet" = 50, "laser" = 30, "energy" = 40, "bomb" = 35, "bio" = 100, "rad" = 50, "fire" = 100, "acid" = 100) - allowed = list(/obj/item/gun, /obj/item/ammo_box, /obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/transforming/energy/sword/saber, /obj/item/restraints/handcuffs, /obj/item/tank/internals) + allowed = list(/obj/item/gun, /obj/item/ammo_box, /obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/energy/sword/saber, /obj/item/restraints/handcuffs, /obj/item/tank/internals) helmettype = /obj/item/clothing/head/helmet/space/hardsuit/shielded/syndi slowdown = 0.5 shield_state = "shield-red" @@ -1199,7 +1199,7 @@ item_state = "hardsuit_solgov" armor = list("melee" = 50, "bullet" = 45, "laser" = 40, "energy" = 30, "bomb" = 60, "bio" = 100, "rad" = 60, "fire" = 90, "acid" = 75) //intentionally the fucking strong, this is master chief-tier armor //is this really what you call the strong?? is this the best solgov has to offer?????? helmettype = /obj/item/clothing/head/helmet/space/hardsuit/solgov - allowed = list(/obj/item/gun, /obj/item/ammo_box,/obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/transforming/energy/sword/saber, /obj/item/restraints/handcuffs, /obj/item/tank/internals) + allowed = list(/obj/item/gun, /obj/item/ammo_box,/obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/energy/sword/saber, /obj/item/restraints/handcuffs, /obj/item/tank/internals) slowdown = 0.5 supports_variations = DIGITIGRADE_VARIATION diff --git a/code/modules/clothing/spacesuits/miscellaneous.dm b/code/modules/clothing/spacesuits/miscellaneous.dm index 6e825e48ea4b..8cf3da8547cd 100644 --- a/code/modules/clothing/spacesuits/miscellaneous.dm +++ b/code/modules/clothing/spacesuits/miscellaneous.dm @@ -153,7 +153,7 @@ Contains: desc = "Yarr." w_class = WEIGHT_CLASS_NORMAL flags_inv = 0 - allowed = list(/obj/item/gun, /obj/item/ammo_box, /obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/restraints/handcuffs, /obj/item/tank/internals, /obj/item/melee/transforming/energy/sword/saber/pirate, /obj/item/clothing/glasses/eyepatch, /obj/item/reagent_containers/food/drinks/bottle/rum) + allowed = list(/obj/item/gun, /obj/item/ammo_box, /obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/restraints/handcuffs, /obj/item/tank/internals, /obj/item/melee/energy/sword/saber/pirate, /obj/item/clothing/glasses/eyepatch, /obj/item/reagent_containers/food/drinks/bottle/rum) slowdown = 0 armor = list("melee" = 30, "bullet" = 50, "laser" = 30,"energy" = 40, "bomb" = 30, "bio" = 30, "rad" = 30, "fire" = 60, "acid" = 75) strip_delay = 40 @@ -363,7 +363,7 @@ Contains: armor = list("melee" = 30, "bullet" = 10, "laser" = 10, "energy" = 20, "bomb" = 10, "bio" = 100, "rad" = 10, "fire" = 100, "acid" = 100) max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT resistance_flags = FIRE_PROOF - allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/pickaxe, /obj/item/melee/spear, /obj/item/organ/regenerative_core/legion, /obj/item/kinetic_crusher, /obj/item/resonator, /obj/item/melee/transforming/cleaving_saw) + allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/pickaxe, /obj/item/melee/spear, /obj/item/organ/regenerative_core/legion, /obj/item/kinetic_crusher, /obj/item/resonator, /obj/item/melee/cleaving_saw) /obj/item/clothing/suit/space/hardsuit/berserker/RemoveHelmet() var/obj/item/clothing/head/helmet/space/hardsuit/berserker/helm = helmet @@ -525,7 +525,7 @@ Contains: icon_state = "vacsuit_solgov" desc = "Originally designed by independent contractors on Luna for the purposes of survival in hazardous environments, the lightweight Tortoise Microlite Armored Suit now sees widespread use by SolGov's exploration teams." item_state = "vacsuit_solgov" - allowed = list(/obj/item/gun, /obj/item/ammo_box, /obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/transforming/energy, /obj/item/tank/internals) + allowed = list(/obj/item/gun, /obj/item/ammo_box, /obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/energy, /obj/item/tank/internals) armor = list("bio" = 100, "rad" = 50, "fire" = 60, "acid" = 75) slowdown = 0.5 w_class = WEIGHT_CLASS_NORMAL diff --git a/code/modules/clothing/spacesuits/plasmamen.dm b/code/modules/clothing/spacesuits/plasmamen.dm index 895dea5156aa..6f8269357eb2 100644 --- a/code/modules/clothing/spacesuits/plasmamen.dm +++ b/code/modules/clothing/spacesuits/plasmamen.dm @@ -4,7 +4,7 @@ /obj/item/clothing/suit/space/eva/plasmaman name = "EVA plasma envirosuit" desc = "A special plasma containment suit designed to be space-worthy, as well as worn over other clothing. Like its smaller counterpart, it can automatically extinguish the wearer in a crisis, and holds twice as many charges." - allowed = list(/obj/item/gun, /obj/item/ammo_casing, /obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/transforming/energy/sword, /obj/item/restraints/handcuffs, /obj/item/tank) + allowed = list(/obj/item/gun, /obj/item/ammo_casing, /obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/energy/sword, /obj/item/restraints/handcuffs, /obj/item/tank) armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 100, "rad" = 0, "fire" = 100, "acid" = 75) resistance_flags = FIRE_PROOF icon_state = "plasmaman_suit" diff --git a/code/modules/clothing/spacesuits/syndi.dm b/code/modules/clothing/spacesuits/syndi.dm index e2a405176c21..67dc2201d60c 100644 --- a/code/modules/clothing/spacesuits/syndi.dm +++ b/code/modules/clothing/spacesuits/syndi.dm @@ -13,7 +13,7 @@ item_state = "space_suit_syndicate" desc = "A space suit made of high-grade ballistic fabric with integrated armor plates. More compact than a normal space suit while almost matching powered hardsuits for protection. Almost." w_class = WEIGHT_CLASS_NORMAL - allowed = list(/obj/item/gun, /obj/item/ammo_box, /obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/transforming/energy/sword/saber, /obj/item/restraints/handcuffs, /obj/item/tank/internals) + allowed = list(/obj/item/gun, /obj/item/ammo_box, /obj/item/ammo_casing, /obj/item/melee/baton, /obj/item/melee/energy/sword/saber, /obj/item/restraints/handcuffs, /obj/item/tank/internals) armor = list("melee" = 30, "bullet" = 15, "laser" = 15, "energy" = 40, "bomb" = 20, "bio" = 100, "rad" = 30, "fire" = 75, "acid" = 75) //Green syndicate space suit diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index c8e54edb2e01..83ec8abff93c 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -37,7 +37,7 @@ desc = "Yarr." icon_state = "pirate" item_state = "pirate" - allowed = list(/obj/item/melee/transforming/energy/sword/saber/pirate, /obj/item/clothing/glasses/eyepatch, /obj/item/reagent_containers/food/drinks/bottle/rum) + allowed = list(/obj/item/melee/energy/sword/saber/pirate, /obj/item/clothing/glasses/eyepatch, /obj/item/reagent_containers/food/drinks/bottle/rum) /obj/item/clothing/suit/pirate/captain name = "pirate captain coat" diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_cake.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_cake.dm index c79d4cea8474..993c75246c6c 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_cake.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_cake.dm @@ -81,7 +81,7 @@ name = "Energy cake" reqs = list( /obj/item/food/cake/birthday = 1, - /obj/item/melee/transforming/energy/sword = 1, + /obj/item/melee/energy/sword = 1, ) blacklist = list(/obj/item/food/cake/birthday/energy) result = /obj/item/food/cake/birthday/energy diff --git a/code/modules/mining/abandoned_crates.dm b/code/modules/mining/abandoned_crates.dm index 4d5a07d4130f..1166a0db0db5 100644 --- a/code/modules/mining/abandoned_crates.dm +++ b/code/modules/mining/abandoned_crates.dm @@ -207,7 +207,7 @@ if(88) new /obj/item/reagent_containers/food/drinks/bottle/lizardwine(src) if(89) - new /obj/item/melee/transforming/energy/sword/bananium(src) + new /obj/item/melee/energy/sword/bananium(src) if(90) new /obj/item/dnainjector/wackymut(src) if(91) diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index d6f8866bb1ec..0ee00128d855 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -1063,93 +1063,6 @@ ///Bosses -//Miniboss Miner - -/obj/item/melee/transforming/cleaving_saw - name = "cleaving saw" - desc = "This saw, effective at drawing the blood of beasts, transforms into a long cleaver that makes use of centrifugal force." - force = 12 - force_on = 20 //force when active - throwforce = 20 - throwforce_on = 20 - icon = 'icons/obj/lavaland/artefacts.dmi' - lefthand_file = 'icons/mob/inhands/64x64_lefthand.dmi' - righthand_file = 'icons/mob/inhands/64x64_righthand.dmi' - inhand_x_dimension = 64 - inhand_y_dimension = 64 - icon_state = "cleaving_saw" - icon_state_on = "cleaving_saw_open" - slot_flags = ITEM_SLOT_BELT - attack_verb_off = list("attacked", "sawed", "sliced", "torn", "ripped", "diced", "cut") - attack_verb_on = list("cleaved", "swiped", "slashed", "chopped") - hitsound = 'sound/weapons/bladeslice.ogg' - hitsound_on = 'sound/weapons/bladeslice.ogg' - w_class = WEIGHT_CLASS_BULKY - sharpness = IS_SHARP - faction_bonus_force = 30 - nemesis_factions = list("mining", "boss") - var/transform_cooldown - var/swiping = FALSE - var/bleed_stacks_per_hit = 3 - -/obj/item/melee/transforming/cleaving_saw/examine(mob/user) - . = ..() - . += "It is [active ? "open, will cleave enemies in a wide arc and deal additional damage to fauna":"closed, and can be used for rapid consecutive attacks that cause fauna to bleed"].\n"+\ - "Both modes will build up existing bleed effects, doing a burst of high damage if the bleed is built up high enough.\n"+\ - "Transforming it immediately after an attack causes the next attack to come out faster." - -/obj/item/melee/transforming/cleaving_saw/transform_weapon(mob/living/user, supress_message_text) - if(transform_cooldown > world.time) - return FALSE - . = ..() - if(.) - transform_cooldown = world.time + (CLICK_CD_MELEE * 0.5) - user.changeNext_move(CLICK_CD_MELEE * 0.25) - -/obj/item/melee/transforming/cleaving_saw/transform_messages(mob/living/user, supress_message_text) - if(!supress_message_text) - if(active) - to_chat(user, "You open [src]. It will now cleave enemies in a wide arc and deal additional damage to fauna.") - else - to_chat(user, "You close [src]. It will now attack rapidly and cause fauna to bleed.") - playsound(user, 'sound/magic/clockwork/fellowship_armory.ogg', 35, TRUE, frequency = 90000 - (active * 30000)) - -/obj/item/melee/transforming/cleaving_saw/clumsy_transform_effect(mob/living/user) - if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)) - to_chat(user, "You accidentally cut yourself with [src], like a doofus!") - user.take_bodypart_damage(10) - -/obj/item/melee/transforming/cleaving_saw/melee_attack_chain(mob/user, atom/target, params) - ..() - if(!active) - user.changeNext_move(CLICK_CD_MELEE * 0.5) //when closed, it attacks very rapidly - -/obj/item/melee/transforming/cleaving_saw/nemesis_effects(mob/living/user, mob/living/target) - var/datum/status_effect/stacking/saw_bleed/B = target.has_status_effect(STATUS_EFFECT_SAWBLEED) - if(!B) - target.apply_status_effect(STATUS_EFFECT_SAWBLEED,bleed_stacks_per_hit) - else - B.add_stacks(bleed_stacks_per_hit) - -/obj/item/melee/transforming/cleaving_saw/attack(mob/living/target, mob/living/carbon/human/user) - if(!active || swiping || !target.density || get_turf(target) == get_turf(user)) - if(!active) - faction_bonus_force = 0 - ..() - if(!active) - faction_bonus_force = initial(faction_bonus_force) - else - var/turf/user_turf = get_turf(user) - var/dir_to_target = get_dir(user_turf, get_turf(target)) - swiping = TRUE - var/static/list/cleaving_saw_cleave_angles = list(0, -45, 45) //so that the animation animates towards the target clicked and not towards a side target - for(var/i in cleaving_saw_cleave_angles) - var/turf/T = get_step(user_turf, turn(dir_to_target, i)) - for(var/mob/living/L in T) - if(user.Adjacent(L) && L.density) - melee_attack_chain(user, L) - swiping = FALSE - //Dragon /obj/structure/closet/crate/necropolis/dragon diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 764ede83aa90..081c94f4a8f9 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -110,22 +110,24 @@ var/final_block_chance = I.block_chance - (clamp((armour_penetration-I.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example if(I.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return TRUE + if(wear_suit) - var/final_block_chance = wear_suit.block_chance - (clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier + var/final_block_chance = wear_suit.block_chance - (clamp((armour_penetration - wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier if(wear_suit.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return TRUE if(w_uniform) - var/final_block_chance = w_uniform.block_chance - (clamp((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier + var/final_block_chance = w_uniform.block_chance - (clamp((armour_penetration - w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier if(w_uniform.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return TRUE if(wear_neck) - var/final_block_chance = wear_neck.block_chance - (clamp((armour_penetration-wear_neck.armour_penetration)/2,0,100)) + block_chance_modifier + var/final_block_chance = wear_neck.block_chance - (clamp((armour_penetration - wear_neck.armour_penetration)/2,0,100)) + block_chance_modifier if(wear_neck.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return TRUE if(head) - var/final_block_chance = head.block_chance - (clamp((armour_penetration-head.armour_penetration)/2,0,100)) + block_chance_modifier + var/final_block_chance = head.block_chance - (clamp((armour_penetration - head.armour_penetration)/2,0,100)) + block_chance_modifier if(head.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type)) return TRUE + return FALSE /mob/living/carbon/human/proc/check_block() diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index f9bb15bb5941..9e2a0bd9aaca 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -258,7 +258,7 @@ /obj/item/restraints/handcuffs/cable/zipties, /obj/item/soap/nanotrasen, /obj/item/borg/cyborghug) - emag_modules = list(/obj/item/melee/transforming/energy/sword/cyborg) + emag_modules = list(/obj/item/melee/energy/sword/cyborg) cyborg_base_icon = "robot" moduleselect_icon = "standard" hat_offset = -3 @@ -976,7 +976,7 @@ name = "Syndicate Assault" basic_modules = list( /obj/item/assembly/flash/cyborg, - /obj/item/melee/transforming/energy/sword/cyborg, + /obj/item/melee/energy/sword/cyborg, /obj/item/gun/energy/printer, /obj/item/gun/ballistic/revolver/grenadelauncher/cyborg, /obj/item/card/emag/borg, @@ -1041,7 +1041,7 @@ /obj/item/cautery, /obj/item/surgicaldrill, /obj/item/scalpel, - /obj/item/melee/transforming/energy/sword/cyborg/saw, + /obj/item/melee/energy/sword/cyborg/saw, /obj/item/roller/robo, /obj/item/card/emag/borg, /obj/item/crowbar/cyborg, diff --git a/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm b/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm index 52346fd7cddd..0f8d8e5cd432 100644 --- a/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm +++ b/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm @@ -5,7 +5,7 @@ icon_state = "grievous" health = 150 maxHealth = 150 - baton_type = /obj/item/melee/transforming/energy/sword/saber + baton_type = /obj/item/melee/energy/sword/saber base_speed = 4 //he's a fast fucker var/block_chance = 50 weapon_force = 30 diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm index 4a072df3ab8b..1f3c2ba24aa7 100644 --- a/code/modules/mob/living/simple_animal/bot/construction.dm +++ b/code/modules/mob/living/simple_animal/bot/construction.dm @@ -404,7 +404,7 @@ new /obj/item/toy/sword(Tsec) if(ASSEMBLY_FIFTH_STEP) - if(istype(I, /obj/item/melee/transforming/energy/sword/saber)) + if(istype(I, /obj/item/melee/energy/sword/saber)) if(swordamt < 3) if(!user.temporarilyRemoveItemFromInventory(I)) return @@ -429,7 +429,7 @@ icon_state = initial(icon_state) to_chat(user, "You unbolt [src]'s energy swords.") for(var/IS in 1 to swordamt) - new /obj/item/melee/transforming/energy/sword/saber(Tsec) + new /obj/item/melee/energy/sword/saber(Tsec) //Firebot Assembly diff --git a/code/modules/mob/living/simple_animal/hostile/human/pirate.dm b/code/modules/mob/living/simple_animal/hostile/human/pirate.dm index 1a30b46f263e..fd33a21fe038 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/pirate.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/pirate.dm @@ -7,7 +7,7 @@ speak_chance = 0 speak_emote = list("yarrs") loot = list(/obj/effect/mob_spawn/human/corpse/pirate, - /obj/item/melee/transforming/energy/sword/saber/pirate) + /obj/item/melee/energy/sword/saber/pirate) faction = list("pirate") /mob/living/simple_animal/hostile/human/pirate/melee diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm index 63519d29c7cd..fc8cbbce6d8c 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner.dm @@ -42,7 +42,7 @@ Difficulty: Medium pixel_x = -16 base_pixel_x = -16 //mob_trophy = /obj/item/mob_trophy/miner_eye - loot = list(/obj/item/melee/transforming/cleaving_saw, /obj/item/gun/energy/kinetic_accelerator) + loot = list(/obj/item/melee/cleaving_saw, /obj/item/gun/energy/kinetic_accelerator) wander = FALSE del_on_death = TRUE blood_volume = BLOOD_VOLUME_NORMAL @@ -50,7 +50,7 @@ Difficulty: Medium achievement_type = /datum/award/achievement/boss/blood_miner_kill crusher_achievement_type = /datum/award/achievement/boss/blood_miner_crusher score_achievement_type = /datum/award/score/blood_miner_score - var/obj/item/melee/transforming/cleaving_saw/miner/miner_saw + var/obj/item/melee/cleaving_saw/miner/miner_saw var/time_until_next_transform = 0 var/dashing = FALSE var/dash_cooldown = 15 @@ -107,11 +107,11 @@ Difficulty: Medium shoot_ka() transform_weapon() -/obj/item/melee/transforming/cleaving_saw/miner //nerfed saw because it is very murdery +/obj/item/melee/cleaving_saw/miner //nerfed saw because it is very murdery force = 6 - force_on = 10 + active_force = 10 -/obj/item/melee/transforming/cleaving_saw/miner/attack(mob/living/target, mob/living/carbon/human/user) +/obj/item/melee/cleaving_saw/miner/attack(mob/living/target, mob/living/carbon/human/user) target.add_stun_absorption("miner", 10, INFINITY) ..() target.stun_absorption -= "miner" @@ -248,14 +248,12 @@ Difficulty: Medium /mob/living/simple_animal/hostile/megafauna/blood_drunk_miner/proc/transform_weapon() if(time_until_next_transform <= world.time) miner_saw.transform_cooldown = 0 - miner_saw.transform_weapon(src, TRUE) - if(!miner_saw.active) - rapid_melee = 5 // 4 deci cooldown before changes, npcpool subsystem wait is 20, 20/4 = 5 - else - rapid_melee = 3 // same thing but halved (slightly rounded up) + miner_saw.attack_self(src) + var/saw_open = HAS_TRAIT(miner_saw, TRAIT_TRANSFORM_ACTIVE) + rapid_melee = saw_open ? 3 : 5 transform_stop_attack = TRUE - icon_state = "miner[miner_saw.active ? "_transformed":""]" - icon_living = "miner[miner_saw.active ? "_transformed":""]" + icon_state = "miner[saw_open ? "_transformed":""]" + icon_living = "miner[saw_open ? "_transformed":""]" time_until_next_transform = world.time + rand(50, 100) /obj/effect/temp_visual/dir_setting/miner_death diff --git a/code/modules/mod/mod_theme.dm b/code/modules/mod/mod_theme.dm index 2e6325df919f..4643fa939206 100644 --- a/code/modules/mod/mod_theme.dm +++ b/code/modules/mod/mod_theme.dm @@ -682,7 +682,7 @@ /obj/item/restraints/handcuffs, /obj/item/assembly/flash, /obj/item/melee/baton, - /obj/item/melee/transforming/energy/sword, + /obj/item/melee/energy/sword, /obj/item/shield/energy, ) skins = list( @@ -733,7 +733,7 @@ /obj/item/restraints/handcuffs, /obj/item/assembly/flash, /obj/item/melee/baton, - /obj/item/melee/transforming/energy/sword, + /obj/item/melee/energy/sword, /obj/item/shield/energy, ) skins = list( @@ -947,7 +947,7 @@ /obj/item/restraints/handcuffs, /obj/item/assembly/flash, /obj/item/melee/baton, - /obj/item/melee/transforming/energy/sword, + /obj/item/melee/energy/sword, /obj/item/shield/energy, ) skins = list( diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 3ba8ef7ec7ac..c23195c81c0f 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -1113,7 +1113,7 @@ GLOBAL_LIST_INIT(gun_saw_types, typecacheof(list( /obj/item/gun/energy/plasmacutter, - /obj/item/melee/transforming/energy, + /obj/item/melee/energy, ))) ///Handles all the logic of sawing off guns, diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index c583354e7eea..6266b62cc7e4 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -14,7 +14,6 @@ desc = "Now comes in flavors like GUN. Uses 10mm ammo, for some reason." name = "projectile gun" w_class = WEIGHT_CLASS_NORMAL - has_safety = TRUE safety = TRUE diff --git a/code/modules/surgery/advanced/lobotomy.dm b/code/modules/surgery/advanced/lobotomy.dm index 0807e1e5c8cc..501cad86da4e 100644 --- a/code/modules/surgery/advanced/lobotomy.dm +++ b/code/modules/surgery/advanced/lobotomy.dm @@ -25,7 +25,7 @@ name = "perform lobotomy" implements = list( TOOL_SCALPEL = 85, // there is no way this should be reasonable to do basically at all without a real surgery. ghetto lobotomy, for real? - /obj/item/melee/transforming/energy/sword = 25, + /obj/item/melee/energy/sword = 25, /obj/item/melee/knife = 15, /obj/item/shard = 10, /obj/item = 5) diff --git a/code/modules/surgery/gastrectomy.dm b/code/modules/surgery/gastrectomy.dm index 6d00f5ae7588..201e9125c06f 100644 --- a/code/modules/surgery/gastrectomy.dm +++ b/code/modules/surgery/gastrectomy.dm @@ -24,7 +24,7 @@ name = "remove lower duodenum" implements = list( TOOL_SCALPEL = 95, - /obj/item/melee/transforming/energy/sword = 33, + /obj/item/melee/energy/sword = 33, /obj/item/melee/knife = 40, /obj/item/shard = 10) time = 52 diff --git a/code/modules/surgery/hepatectomy.dm b/code/modules/surgery/hepatectomy.dm index 0571cf9b2397..b5b017831d77 100644 --- a/code/modules/surgery/hepatectomy.dm +++ b/code/modules/surgery/hepatectomy.dm @@ -23,7 +23,7 @@ name = "remove damaged liver section" implements = list( TOOL_SCALPEL = 95, - /obj/item/melee/transforming/energy/sword = 33, + /obj/item/melee/energy/sword = 33, /obj/item/melee/knife = 40, /obj/item/shard = 25) time = 52 diff --git a/code/modules/surgery/lobectomy.dm b/code/modules/surgery/lobectomy.dm index 79d3d79bcee5..9e9b8e5241a0 100644 --- a/code/modules/surgery/lobectomy.dm +++ b/code/modules/surgery/lobectomy.dm @@ -22,7 +22,7 @@ name = "excise damaged lung node" implements = list( TOOL_SCALPEL = 95, - /obj/item/melee/transforming/energy/sword = 33, + /obj/item/melee/energy/sword = 33, /obj/item/melee/knife = 40, /obj/item/shard = 25) time = 4.2 SECONDS diff --git a/code/modules/surgery/mechanical.dm b/code/modules/surgery/mechanical.dm index 0c73c34bd0c7..2cf72dab1731 100644 --- a/code/modules/surgery/mechanical.dm +++ b/code/modules/surgery/mechanical.dm @@ -33,14 +33,14 @@ TOOL_CAUTERY = 60, TOOL_HEMOSTAT = 60, TOOL_RETRACTOR = 60, - /obj/item/melee/transforming/energy = 40, + /obj/item/melee/energy = 40, /obj/item/gun/energy/laser = 20) time = 2 SECONDS missinghpbonus = 10 /datum/surgery_step/heal/mechanic/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) var/repairtype - if(tool.tool_behaviour == TOOL_WELDER || tool.tool_behaviour == TOOL_CAUTERY || istype(tool, /obj/item/melee/transforming/energy) || istype(tool, /obj/item/gun/energy/laser)) + if(tool.tool_behaviour == TOOL_WELDER || tool.tool_behaviour == TOOL_CAUTERY || istype(tool, /obj/item/melee/energy) || istype(tool, /obj/item/gun/energy/laser)) brutehealing = 5 burnhealing = 0 repairtype = "dents" diff --git a/code/modules/surgery/organic_steps.dm b/code/modules/surgery/organic_steps.dm index 39fb1d71b258..a3df7efc62ae 100644 --- a/code/modules/surgery/organic_steps.dm +++ b/code/modules/surgery/organic_steps.dm @@ -4,7 +4,7 @@ name = "make incision" implements = list( TOOL_SCALPEL = 100, - /obj/item/melee/transforming/energy/sword = 40, + /obj/item/melee/energy/sword = 40, /obj/item/melee/knife = 40, /obj/item/shard = 25, /obj/item = 15) //any sharp item diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm index 665086d1981d..27ccf1421a3f 100644 --- a/code/modules/surgery/organs/augments_arms.dm +++ b/code/modules/surgery/organs/augments_arms.dm @@ -242,7 +242,7 @@ /obj/item/organ/cyberimp/arm/esword name = "arm-mounted energy blade" desc = "An illegal and highly dangerous cybernetic implant that can project a deadly blade of concentrated energy." - items_to_create = list(/obj/item/melee/transforming/energy/blade/hardlight) + items_to_create = list(/obj/item/melee/energy/blade/hardlight) /obj/item/organ/cyberimp/arm/medibeam name = "integrated medical beamgun" @@ -280,7 +280,7 @@ /obj/item/organ/cyberimp/arm/combat name = "combat cybernetics implant" desc = "A powerful cybernetic implant that contains combat modules built into the user's arm." - items_to_create = list(/obj/item/melee/transforming/energy/blade/hardlight, /obj/item/gun/medbeam, /obj/item/borg/stun, /obj/item/assembly/flash/armimplant) + items_to_create = list(/obj/item/melee/energy/blade/hardlight, /obj/item/gun/medbeam, /obj/item/borg/stun, /obj/item/assembly/flash/armimplant) /obj/item/organ/cyberimp/arm/combat/Initialize() . = ..() diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index 5364a69c3483..3195d86e7fb7 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -69,7 +69,6 @@ #define TEST_OUTPUT_GREEN(text) (text) #endif - #ifdef BASIC_TESTS #include "icons/inhands.dm" diff --git a/code/modules/unit_tests/icons/inhands.dm b/code/modules/unit_tests/icons/inhands.dm index dc05295203e6..b3e5265e2f0b 100644 --- a/code/modules/unit_tests/icons/inhands.dm +++ b/code/modules/unit_tests/icons/inhands.dm @@ -26,7 +26,7 @@ //Add EVEN MORE paths if needed here! //generate_possible_icon_states_list("your/folder/path/inhands/") - for(var/obj/item/item_path as anything in subtypesof(/obj/item)) + for(var/obj/item/item_path as anything in (subtypesof(/obj/item))) if(initial(item_path.item_flags) & ABSTRACT) continue diff --git a/code/modules/unit_tests/icons/missing_icons.dm b/code/modules/unit_tests/icons/missing_icons.dm index f548d2844a0f..36343da89c25 100644 --- a/code/modules/unit_tests/icons/missing_icons.dm +++ b/code/modules/unit_tests/icons/missing_icons.dm @@ -54,4 +54,3 @@ for(var/file_place in possible_icon_states[icon_state]) match_message += (match_message ? " & '[file_place]'" : " - Matching sprite found in: '[file_place]'") TEST_FAIL("Missing icon_state for [obj_path] in '[icon]'.\n\ticon_state = \"[icon_state]\"[match_message]") - diff --git a/code/modules/unit_tests/outfit_sanity.dm b/code/modules/unit_tests/outfit_sanity.dm index 8e85797e713e..6fc875d94837 100644 --- a/code/modules/unit_tests/outfit_sanity.dm +++ b/code/modules/unit_tests/outfit_sanity.dm @@ -74,5 +74,4 @@ else TEST_NOTICE(src, "[outfit.name]'s backpack_contents are invalid! Couldn't add [path] to backpack.") - #undef CHECK_OUTFIT_SLOT diff --git a/code/modules/uplink/uplink_items.dm b/code/modules/uplink/uplink_items.dm index ef38d21a7740..b10fd114db61 100644 --- a/code/modules/uplink/uplink_items.dm +++ b/code/modules/uplink/uplink_items.dm @@ -360,7 +360,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) name = "Bananium Energy Sword" desc = "An energy sword that deals no damage, but will slip anyone it contacts, be it by melee attack, thrown \ impact, or just stepping on it. Beware friendly fire, as even anti-slip shoes will not protect against it." - item = /obj/item/melee/transforming/energy/sword/bananium + item = /obj/item/melee/energy/sword/bananium cost = 3 surplus = 0 include_modes = list(/datum/game_mode/nuclear/clown_ops) @@ -417,7 +417,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) name = "Energy Sword" desc = "The energy sword is an edged weapon with a blade of pure energy. The sword is small enough to be \ pocketed when inactive. Activating it produces a loud, distinctive noise." - item = /obj/item/melee/transforming/energy/sword/saber + item = /obj/item/melee/energy/sword/saber cost = 8 exclude_modes = list(/datum/game_mode/nuclear/clown_ops) diff --git a/icons/mob/inhands/64x64_lefthand.dmi b/icons/mob/inhands/64x64_lefthand.dmi index 50a17a22d470..64efd1262a22 100644 Binary files a/icons/mob/inhands/64x64_lefthand.dmi and b/icons/mob/inhands/64x64_lefthand.dmi differ diff --git a/icons/mob/inhands/64x64_righthand.dmi b/icons/mob/inhands/64x64_righthand.dmi index bbeddf915282..e91c7830c614 100644 Binary files a/icons/mob/inhands/64x64_righthand.dmi and b/icons/mob/inhands/64x64_righthand.dmi differ diff --git a/icons/mob/inhands/weapons/axes_lefthand.dmi b/icons/mob/inhands/weapons/axes_lefthand.dmi index 3b95d17cdc78..584ca2b2290e 100644 Binary files a/icons/mob/inhands/weapons/axes_lefthand.dmi and b/icons/mob/inhands/weapons/axes_lefthand.dmi differ diff --git a/icons/mob/inhands/weapons/axes_righthand.dmi b/icons/mob/inhands/weapons/axes_righthand.dmi index 1f5273d20d30..8a29d67a8871 100644 Binary files a/icons/mob/inhands/weapons/axes_righthand.dmi and b/icons/mob/inhands/weapons/axes_righthand.dmi differ diff --git a/icons/mob/inhands/weapons/chainsaw_lefthand.dmi b/icons/mob/inhands/weapons/chainsaw_lefthand.dmi index 5235f1510102..658f772c9c75 100644 Binary files a/icons/mob/inhands/weapons/chainsaw_lefthand.dmi and b/icons/mob/inhands/weapons/chainsaw_lefthand.dmi differ diff --git a/icons/mob/inhands/weapons/chainsaw_righthand.dmi b/icons/mob/inhands/weapons/chainsaw_righthand.dmi index 0800a5273156..21035a077de9 100644 Binary files a/icons/mob/inhands/weapons/chainsaw_righthand.dmi and b/icons/mob/inhands/weapons/chainsaw_righthand.dmi differ diff --git a/icons/mob/inhands/weapons/polearms_lefthand.dmi b/icons/mob/inhands/weapons/polearms_lefthand.dmi index afe36277e9f5..f7a1aa75a665 100644 Binary files a/icons/mob/inhands/weapons/polearms_lefthand.dmi and b/icons/mob/inhands/weapons/polearms_lefthand.dmi differ diff --git a/icons/mob/inhands/weapons/polearms_righthand.dmi b/icons/mob/inhands/weapons/polearms_righthand.dmi index b72556f0b135..1fae6b8eb45d 100644 Binary files a/icons/mob/inhands/weapons/polearms_righthand.dmi and b/icons/mob/inhands/weapons/polearms_righthand.dmi differ diff --git a/icons/mob/inhands/weapons/staves_lefthand.dmi b/icons/mob/inhands/weapons/staves_lefthand.dmi index da61d8df47ea..151e9645b371 100644 Binary files a/icons/mob/inhands/weapons/staves_lefthand.dmi and b/icons/mob/inhands/weapons/staves_lefthand.dmi differ diff --git a/icons/mob/inhands/weapons/staves_righthand.dmi b/icons/mob/inhands/weapons/staves_righthand.dmi index 3cb569627eaa..8df69b74cc36 100644 Binary files a/icons/mob/inhands/weapons/staves_righthand.dmi and b/icons/mob/inhands/weapons/staves_righthand.dmi differ diff --git a/icons/mob/inhands/weapons/swords_lefthand.dmi b/icons/mob/inhands/weapons/swords_lefthand.dmi index 49732e254e41..fc5ed5ee90b2 100644 Binary files a/icons/mob/inhands/weapons/swords_lefthand.dmi and b/icons/mob/inhands/weapons/swords_lefthand.dmi differ diff --git a/icons/mob/inhands/weapons/swords_righthand.dmi b/icons/mob/inhands/weapons/swords_righthand.dmi index 93a806555870..6e04504c3fb7 100644 Binary files a/icons/mob/inhands/weapons/swords_righthand.dmi and b/icons/mob/inhands/weapons/swords_righthand.dmi differ diff --git a/icons/obj/lavaland/artefacts.dmi b/icons/obj/lavaland/artefacts.dmi index 6793b0c10cb8..4239f83aa0e9 100644 Binary files a/icons/obj/lavaland/artefacts.dmi and b/icons/obj/lavaland/artefacts.dmi differ diff --git a/icons/obj/surgery.dmi b/icons/obj/surgery.dmi index 816d3671a8d9..e213c294d669 100644 Binary files a/icons/obj/surgery.dmi and b/icons/obj/surgery.dmi differ diff --git a/icons/obj/weapon/axe.dmi b/icons/obj/weapon/axe.dmi index 0ff8a4364833..46d9982ab5f2 100644 Binary files a/icons/obj/weapon/axe.dmi and b/icons/obj/weapon/axe.dmi differ diff --git a/icons/obj/weapon/baton.dmi b/icons/obj/weapon/baton.dmi index c39a8b4e073b..4c63ef28b8aa 100644 Binary files a/icons/obj/weapon/baton.dmi and b/icons/obj/weapon/baton.dmi differ diff --git a/icons/obj/weapon/blunt.dmi b/icons/obj/weapon/blunt.dmi index 480515bbd794..013f4fd1db2b 100644 Binary files a/icons/obj/weapon/blunt.dmi and b/icons/obj/weapon/blunt.dmi differ diff --git a/icons/obj/weapon/energy.dmi b/icons/obj/weapon/energy.dmi index 5100d715923a..79742da9d23c 100644 Binary files a/icons/obj/weapon/energy.dmi and b/icons/obj/weapon/energy.dmi differ diff --git a/icons/obj/weapon/spear.dmi b/icons/obj/weapon/spear.dmi index 98b3761430ed..384f1c751bcf 100644 Binary files a/icons/obj/weapon/spear.dmi and b/icons/obj/weapon/spear.dmi differ diff --git a/icons/obj/weapon/sword.dmi b/icons/obj/weapon/sword.dmi index a81830bd7cfb..915be217a2af 100644 Binary files a/icons/obj/weapon/sword.dmi and b/icons/obj/weapon/sword.dmi differ diff --git a/shiptest.dme b/shiptest.dme index e5b36a091b38..5a0cb2785b17 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -174,6 +174,7 @@ #include "code\__DEFINES\dcs\signals\signals_obj\signals_item\signals_hydroponic.dm" #include "code\__DEFINES\dcs\signals\signals_obj\signals_item\signals_implant.dm" #include "code\__DEFINES\dcs\signals\signals_obj\signals_item\signals_item.dm" +#include "code\__DEFINES\dcs\signals\signals_obj\signals_item\signals_transform.dm" #include "code\__DEFINES\dcs\signals\signals_obj\signals_machine\signals_aquarium.dm" #include "code\__DEFINES\dcs\signals\signals_obj\signals_machine\signals_machinery.dm" #include "code\__DEFINES\dcs\signals\signals_obj\signals_machine\signals_supermatter.dm" @@ -559,7 +560,6 @@ #include "code\datums\components\taped.dm" #include "code\datums\components\tether.dm" #include "code\datums\components\thermite.dm" -#include "code\datums\components\twohanded.dm" #include "code\datums\components\udder.dm" #include "code\datums\components\uplink.dm" #include "code\datums\components\wearertargeting.dm" @@ -579,6 +579,9 @@ #include "code\datums\components\fantasy\suffixes.dm" #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\transforming.dm" +#include "code\datums\components\melee\twohanded.dm" #include "code\datums\components\plumbing\_plumbing.dm" #include "code\datums\components\plumbing\chemical_acclimator.dm" #include "code\datums\components\plumbing\filter.dm" @@ -1342,7 +1345,7 @@ #include "code\game\objects\items\melee\stunbaton.dm" #include "code\game\objects\items\melee\sword.dm" #include "code\game\objects\items\melee\teleprod.dm" -#include "code\game\objects\items\melee\transforming.dm" +#include "code\game\objects\items\melee\trickweapon.dm" #include "code\game\objects\items\melee\weaponry.dm" #include "code\game\objects\items\robot\ai_upgrades.dm" #include "code\game\objects\items\robot\robot_items.dm"