diff --git a/code/game/objects/items/tools/welder.dm b/code/game/objects/items/tools/welder.dm index 543dd83d6cd..053ff17d997 100644 --- a/code/game/objects/items/tools/welder.dm +++ b/code/game/objects/items/tools/welder.dm @@ -87,15 +87,23 @@ remove_fuel(maximum_fuel) /obj/item/weldingtool/attack_self(mob/user) + if(try_toggle_welder(user)) + return ..() + +/obj/item/weldingtool/proc/try_toggle_welder(mob/user, manual_toggle = TRUE) if(tool_enabled) //Turn off the welder if it's on - to_chat(user, "You switch off [src].") - toggle_welder() - return + balloon_alert(user, "выключено") + if(manual_toggle) + toggle_welder() + return TRUE else if(GET_FUEL) //The welder is off, but we need to check if there is fuel in the tank - to_chat(user, "You switch on [src].") - toggle_welder() + balloon_alert(user, "включено") + if(manual_toggle) + toggle_welder() + return TRUE else //The welder is off and unfuelled - to_chat(user, "[src] is out of fuel!") + balloon_alert(user, "нет топлива!") + return FALSE /obj/item/weldingtool/proc/toggle_welder(turn_off = FALSE) //Turn it on or off, forces it to deactivate tool_enabled = turn_off ? FALSE : !tool_enabled diff --git a/code/game/objects/items/weapons/cigs.dm b/code/game/objects/items/weapons/cigs.dm index a548b051206..1623198aa22 100644 --- a/code/game/objects/items/weapons/cigs.dm +++ b/code/game/objects/items/weapons/cigs.dm @@ -98,6 +98,11 @@ LIGHTERS ARE IN LIGHTERS.DM /obj/item/clothing/mask/cigarette/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/weldingtool/sword)) + if(I.tool_enabled) + light(span_notice("[user] непринуждённо зажига[pluralize_ru(user, "ет", "ют")] [declent_ru(ACCUSATIVE)] с помощью [I.declent_ru(GENITIVE)]. Чёрт, как же он[genderize_ru(user.gender, "", "а", "о", "и")] крут[genderize_ru(user.gender, "", "а", "о", "ы")].")) + return ATTACK_CHAIN_PROCEED_SUCCESS + if(istype(I, /obj/item/lighter/zippo)) add_fingerprint(user) var/obj/item/lighter/zippo/zippo = I diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 85a4c2e9fa4..ea12b209997 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -271,10 +271,10 @@ return . if(prob(50)) - INVOKE_ASYNC(src, PROC_REF(jedi_spin), user) + INVOKE_ASYNC(src, GLOBAL_PROC_REF(jedi_spin), user) -/obj/item/twohanded/dualsaber/proc/jedi_spin(mob/living/user) +/proc/jedi_spin(mob/living/user) for(var/i in list(NORTH, SOUTH, EAST, WEST, EAST, SOUTH, NORTH, SOUTH, EAST, WEST, EAST, SOUTH)) user.setDir(i) if(i == WEST) diff --git a/code/game/objects/items/weapons/welder_sword.dm b/code/game/objects/items/weapons/welder_sword.dm new file mode 100644 index 00000000000..713c2ddcc42 --- /dev/null +++ b/code/game/objects/items/weapons/welder_sword.dm @@ -0,0 +1,144 @@ +/obj/item/weldingtool/sword + name = "welding sword" + desc = "Сварочный аппарат, кустарно модифицированный каким-то умельцем. Судя по всему, автор этого творения черпал вдохновение от энергетических мечей." + ru_names = list( + NOMINATIVE = "сварочный меч", + GENITIVE = "сварочного меча", + DATIVE = "сварочному мечу", + ACCUSATIVE = "сварочный меч", + INSTRUMENTAL = "сварочным мечом", + PREPOSITIONAL = "сварочном мече" + ) + icon = 'icons/obj/items.dmi' + icon_state = "fuelsword" + item_state = "fuelsword" + needs_permit = 1 + belt_icon = null + force_enabled = 30 + low_fuel_changes_icon = FALSE + block_chance = 50 + item_flags = NOSHARPENING + sharp = 1 + tool_behaviour = NONE + maximum_fuel = 50 + origin_tech = "combat=3;magnets=4;plasmatech=5;" + /// Сan be combined with other similar item + var/combinable = TRUE + + +/obj/item/weldingtool/sword/toggle_welder(turn_off) + . = ..() + if(tool_enabled) + tool_behaviour = NONE + else + tool_behaviour = TOOL_WELDER + +/obj/item/weldingtool/sword/update_icon_state() + . = ..() + if(tool_enabled) + icon_state = "[initial(item_state)]1" + else + icon_state = "[initial(item_state)]" + +/obj/item/weldingtool/sword/tool_use_check(mob/living/user, amount, silent) + return FALSE + +/obj/item/weldingtool/sword/afterattack(atom/target, mob/user, proximity, params, status) + . = ..() + if(ATTACK_CHAIN_SUCCESS_CHECK(status)) + remove_fuel(1) + +/obj/item/weldingtool/sword/attackby(obj/item/I, mob/living/user, params) + if(istype(I, /obj/item/weldingtool/sword) && combinable) + add_fingerprint(user) + var/obj/item/weldingtool/sword/sword = I + + if(!sword.combinable) + return ATTACK_CHAIN_PROCEED + + if(I == src) + to_chat(user, span_warning("Вы пытаетесь приделать конец меча к... мечу. Это было очень глупо.")) + user.apply_damage(10, BRAIN) + return ATTACK_CHAIN_PROCEED + + if(loc == user && !user.can_unEquip(src)) + return ATTACK_CHAIN_PROCEED + + if(!user.drop_transfer_item_to_loc(I, src)) + return ATTACK_CHAIN_PROCEED + + balloon_alert(user, "скреплено вместе") + var/obj/item/weldingtool/sword/double/dual_sword = new(drop_location()) + user.temporarily_remove_item_from_inventory(src) + user.put_in_hands(dual_sword, ignore_anim = FALSE) + qdel(I) + qdel(src) + return ATTACK_CHAIN_BLOCKED_ALL + + return ..() + +/obj/item/weldingtool/sword/double + name = "double-bladed welding sword" + desc = "Два кустарно модифицированных сварочных аппарата, скреплённых вместе, образуя некое подобие двойного энергетического меча. Настоящее чудо ассистентской мысли." + ru_names = list( + NOMINATIVE = "двойной сварочный меч", + GENITIVE = "двойного сварочного меча", + DATIVE = "двойному сварочному мечу", + ACCUSATIVE = "двойной сварочный меч", + INSTRUMENTAL = "двойным сварочным мечом", + PREPOSITIONAL = "двойном сварочном мече" + ) + icon_state = "fuelsworddouble" + item_state = "fuelsworddouble" + force_enabled = 40 + force = 5 + block_chance = 75 + maximum_fuel = 70 + attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") + origin_tech = "combat=5;magnets=5;plasmatech=6;" + combinable = FALSE + +/obj/item/weldingtool/sword/double/ComponentInitialize() + AddComponent(/datum/component/two_handed, \ + force_unwielded = force, \ + force_wielded = force_enabled, \ + wieldsound = activation_sound, \ + unwieldsound = deactivation_sound, \ + sharp_when_wielded = TRUE, \ + wield_callback = CALLBACK(src, PROC_REF(wield)), \ + unwield_callback = CALLBACK(src, PROC_REF(unwield)), \ + ) + + +/obj/item/weldingtool/sword/double/proc/wield(obj/item/source, mob/living/carbon/user) + toggle_welder() + + +/obj/item/weldingtool/sword/double/proc/unwield(obj/item/source, mob/living/carbon/user) + toggle_welder() + + +/obj/item/weldingtool/sword/double/remove_fuel(amount) + reagents.remove_reagent("fuel", amount * requires_fuel) + if(!GET_FUEL && tool_enabled) + attack_self(usr) + + +/obj/item/weldingtool/sword/double/try_toggle_welder(mob/user, manual_toggle = TRUE) + return ..(user, manual_toggle = FALSE) + + +/obj/item/weldingtool/sword/double/attack(mob/living/target, mob/living/user, params, def_zone, skip_attack_anim = FALSE) + . = ..() + if(!ATTACK_CHAIN_SUCCESS_CHECK(.) || !HAS_TRAIT(src, TRAIT_WIELDED)) + return . + + if(prob(50)) + INVOKE_ASYNC(src, GLOBAL_PROC_REF(jedi_spin), user) + + +/obj/item/weldingtool/sword/double/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = ITEM_ATTACK) + if(tool_enabled) + return ..() + return FALSE + diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 965ac4fc1e3..0f959176c05 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -106,6 +106,7 @@ investigate_log("[key_name_log(P.firer)] triggered a fueltank explosion with [P.name]", INVESTIGATE_BOMB) ..() + /obj/structure/reagent_dispensers/fueltank/boom(rigtrigger = FALSE, log_attack = FALSE) // Prevent case where someone who rigged the tank is blamed for the explosion when the rig isn't what triggered the explosion if(rigtrigger) // If the explosion is triggered by an assembly holder add_attack_logs(lastrigger, src, "rigged fuel tank exploded", ATKLOG_FEW) @@ -151,6 +152,11 @@ /obj/structure/reagent_dispensers/fueltank/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/weldingtool/sword)) + if(I.tool_enabled) + boom(FALSE, TRUE) + return ATTACK_CHAIN_BLOCKED_ALL + if(istype(I, /obj/item/assembly_holder)) add_fingerprint(user) var/obj/item/assembly_holder/assembly = I diff --git a/icons/mob/inhands/items_lefthand.dmi b/icons/mob/inhands/items_lefthand.dmi index df670a6fada..5258293d01d 100755 Binary files a/icons/mob/inhands/items_lefthand.dmi and b/icons/mob/inhands/items_lefthand.dmi differ diff --git a/icons/mob/inhands/items_righthand.dmi b/icons/mob/inhands/items_righthand.dmi index 10723f454a9..5584bc4562e 100755 Binary files a/icons/mob/inhands/items_righthand.dmi and b/icons/mob/inhands/items_righthand.dmi differ diff --git a/icons/obj/items.dmi b/icons/obj/items.dmi index a7291fdee7f..bc70bbe144d 100644 Binary files a/icons/obj/items.dmi and b/icons/obj/items.dmi differ diff --git a/paradise.dme b/paradise.dme index 31a005dc9a4..cc04166fe1c 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1297,6 +1297,7 @@ #include "code\game\objects\items\weapons\twohanded.dm" #include "code\game\objects\items\weapons\vending_items.dm" #include "code\game\objects\items\weapons\weaponry.dm" +#include "code\game\objects\items\weapons\welder_sword.dm" #include "code\game\objects\items\weapons\whetstone.dm" #include "code\game\objects\items\weapons\grenades\atmosgrenade.dm" #include "code\game\objects\items\weapons\grenades\bananade.dm"