Porting the twohanded component.
This commit is contained in:
@@ -24,24 +24,22 @@
|
||||
if(istype(I, /obj/item/melee/transforming/energy))
|
||||
to_chat(user, "<span class='warning'>You don't think \the [I] will be the thing getting modified if you use it on \the [src]!</span>")
|
||||
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)
|
||||
to_chat(user, "<span class='warning'>[TH] is much too powerful to sharpen further!</span>")
|
||||
return
|
||||
if(TH.wielded)
|
||||
to_chat(user, "<span class='warning'>[TH] must be unwielded before it can be sharpened!</span>")
|
||||
return
|
||||
if(TH.force_wielded > initial(TH.force_wielded))
|
||||
to_chat(user, "<span class='warning'>[TH] has already been refined before. It cannot be sharpened further!</span>")
|
||||
return
|
||||
TH.force_wielded = clamp(TH.force_wielded + increment, 0, max)//wieldforce is increased since normal force wont stay
|
||||
if(I.force > initial(I.force))
|
||||
|
||||
var/signal_out = SEND_SIGNAL(I, COMSIG_ITEM_SHARPEN_ACT, increment, max)
|
||||
if(signal_out & COMPONENT_BLOCK_SHARPEN_MAXED)
|
||||
to_chat(user, "<span class='warning'>[I] is much too powerful to sharpen further!</span>")
|
||||
return
|
||||
if(signal_out & COMPONENT_BLOCK_SHARPEN_BLOCKED)
|
||||
to_chat(user, "<span class='warning'>[I] is not able to be sharpened right now!</span>")
|
||||
return
|
||||
if((signal_out & COMPONENT_BLOCK_SHARPEN_ALREADY) || (I.force > initial(I.force) && !signal_out))
|
||||
to_chat(user, "<span class='warning'>[I] has already been refined before. It cannot be sharpened further!</span>")
|
||||
return
|
||||
if(!(signal_out & COMPONENT_BLOCK_SHARPEN_APPLIED))
|
||||
I.force = clamp(I.force + increment, 0, max)
|
||||
|
||||
user.visible_message("<span class='notice'>[user] sharpens [I] with [src]!</span>", "<span class='notice'>You sharpen [I], making it much more deadly than before.</span>")
|
||||
I.sharpness = IS_SHARP_ACCURATE
|
||||
I.force = clamp(I.force + increment, 0, max)
|
||||
I.throwforce = clamp(I.throwforce + increment, 0, max)
|
||||
I.name = "[prefix] [I.name]"
|
||||
name = "worn out [name]"
|
||||
|
||||
Reference in New Issue
Block a user