diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index 85120a8b22c..d5476bd11b8 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -2,6 +2,8 @@ var/active = FALSE var/force_on = 30 //force when active var/throwforce_on = 20 + var/force_off //Used to properly reset the force + var/throwforce_off var/faction_bonus_force = 0 //Bonus force dealt against certain factions var/list/nemesis_factions //Any mob with a faction that exists in this list will take bonus damage/effects stealthy_audio = TRUE //Most of these are antag weps so we dont want them to be /too/ overt. @@ -19,6 +21,11 @@ var/brightness_on = 2 var/colormap = list(red=LIGHT_COLOR_RED, blue=LIGHT_COLOR_LIGHTBLUE, green=LIGHT_COLOR_GREEN, purple=LIGHT_COLOR_PURPLE, rainbow=LIGHT_COLOR_WHITE) +/obj/item/melee/energy/Initialize(mapload) + . = ..() + force_off = initial(force) //We want to check this only when initializing, not when swapping, so sharpening works. + throwforce_off = initial(throwforce) + /obj/item/melee/energy/attack(mob/living/target, mob/living/carbon/human/user) var/nemesis_faction = FALSE if(LAZYLEN(nemesis_factions)) @@ -59,8 +66,8 @@ playsound(user, 'sound/weapons/saberon.ogg', 35, 1) //changed it from 50% volume to 35% because deafness to_chat(user, "[src] is now active.") else - force = initial(force) - throwforce = initial(throwforce) + force = force_off + throwforce = throwforce_off hitsound = initial(hitsound) throw_speed = initial(throw_speed) if(attack_verb_on.len) @@ -318,8 +325,8 @@ playsound(user, 'sound/magic/fellowship_armory.ogg', 35, TRUE, frequency = 90000 - (active * 30000)) to_chat(user, "You open [src]. It will now cleave enemies in a wide arc and deal additional damage to fauna.") else - force = initial(force) - throwforce = initial(throwforce) + force = force_off + throwforce = throwforce_off hitsound = initial(hitsound) throw_speed = initial(throw_speed) if(attack_verb_on.len) diff --git a/code/game/objects/items/weapons/whetstone.dm b/code/game/objects/items/weapons/whetstone.dm index 12ae803eab0..de57555ff94 100644 --- a/code/game/objects/items/weapons/whetstone.dm +++ b/code/game/objects/items/weapons/whetstone.dm @@ -25,16 +25,22 @@ return if(istype(I, /obj/item/twohanded))//some twohanded items should still be sharpenable, but handle force differently. therefore i need this stuff var/obj/item/twohanded/TH = I - if(TH.force_wielded >= max) + if(TH.force_wielded >= max || TH.force_wielded > initial(TH.force_wielded)) to_chat(user, "[TH] is much too powerful to sharpen further!") return - if(TH.wielded) - to_chat(user, "[TH] must be unwielded before it can be sharpened!") - return - if(TH.force_wielded > initial(TH.force_wielded)) - to_chat(user, "[TH] has already been refined before. It cannot be sharpened further!") - return TH.force_wielded = clamp(TH.force_wielded + increment, 0, max)//wieldforce is increased since normal force wont stay + TH.force_unwielded = clamp(TH.force_unwielded + increment, 0, max) + + if(istype(I, /obj/item/melee/energy)) + var/obj/item/melee/energy/E = I + if(E.force_on > initial(E.force_on) || (E.force > initial(E.force))) + to_chat(user, "[E] is much too powerful to sharpen further!") + return + E.throwforce_on = clamp(E.throwforce_on + increment, 0, max) + E.throwforce_off = clamp(E.throwforce_off + increment, 0, max) + E.force_on = clamp(E.force_on + increment, 0, max) + E.force_off = clamp(E.force_off + increment, 0, max) + if(I.force > initial(I.force)) to_chat(user, "[I] has already been refined before. It cannot be sharpened further!") return