code folder. 221 files changed wew
This commit is contained in:
@@ -2,77 +2,34 @@
|
||||
///// Construction datums //////
|
||||
////////////////////////////////
|
||||
|
||||
/datum/construction/mecha/custom_action(step, atom/used_atom, mob/user)
|
||||
if(istype(used_atom, /obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/W = used_atom
|
||||
if (W.remove_fuel(0, user))
|
||||
/datum/construction/mecha/custom_action(step, obj/item/I, mob/user)
|
||||
if(I.tool_behaviour == TOOL_WELDER)
|
||||
if(I.use_tool(holder, user, 0))
|
||||
playsound(holder, 'sound/items/welder2.ogg', 50, 1)
|
||||
else
|
||||
return FALSE
|
||||
else if(istype(used_atom, /obj/item/wrench))
|
||||
var/obj/item/W = used_atom
|
||||
playsound(holder, W.usesound, 50, 1)
|
||||
|
||||
else if(istype(used_atom, /obj/item/screwdriver))
|
||||
var/obj/item/W = used_atom
|
||||
playsound(holder, W.usesound, 50, 1)
|
||||
else if(I.tool_behaviour)
|
||||
return I.use_tool(holder, user, 0, volume=50)
|
||||
|
||||
else if(istype(used_atom, /obj/item/wirecutters))
|
||||
var/obj/item/W = used_atom
|
||||
playsound(holder, W.usesound, 50, 1)
|
||||
else if(istype(I, /obj/item/stack))
|
||||
return I.use_tool(holder, user, 0, volume=50, amount=5)
|
||||
|
||||
else if(istype(used_atom, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = used_atom
|
||||
if(C.use(4))
|
||||
playsound(holder, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
else
|
||||
to_chat(user, ("<span class='warning'>There's not enough cable to finish the task!</span>"))
|
||||
return FALSE
|
||||
else if(istype(used_atom, /obj/item/stack/ore/bluespace_crystal))
|
||||
var/obj/item/stack/ore/bluespace_crystal/BSC = used_atom
|
||||
BSC.use(1)
|
||||
else if(istype(used_atom, /obj/item/stack))
|
||||
var/obj/item/stack/S = used_atom
|
||||
if(S.get_amount() < 5)
|
||||
to_chat(user, ("<span class='warning'>There's not enough material in this stack!</span>"))
|
||||
return FALSE
|
||||
else
|
||||
S.use(5)
|
||||
return TRUE
|
||||
|
||||
/datum/construction/reversible/mecha/custom_action(index as num, diff as num, atom/used_atom, mob/user)
|
||||
if(istype(used_atom, /obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/W = used_atom
|
||||
if (W.remove_fuel(0, user))
|
||||
/datum/construction/reversible/mecha/custom_action(index as num, diff as num, obj/item/I, mob/user)
|
||||
if(I.tool_behaviour == TOOL_WELDER)
|
||||
if(I.use_tool(holder, user, 0))
|
||||
playsound(holder, 'sound/items/welder2.ogg', 50, 1)
|
||||
else
|
||||
return FALSE
|
||||
else if(istype(used_atom, /obj/item/wrench))
|
||||
var/obj/item/W = used_atom
|
||||
playsound(holder, W.usesound, 50, 1)
|
||||
|
||||
else if(istype(used_atom, /obj/item/screwdriver))
|
||||
var/obj/item/W = used_atom
|
||||
playsound(holder, W.usesound, 50, 1)
|
||||
else if(I.tool_behaviour)
|
||||
return I.use_tool(holder, user, 0, volume=50)
|
||||
|
||||
else if(istype(used_atom, /obj/item/wirecutters))
|
||||
var/obj/item/W = used_atom
|
||||
playsound(holder, W.usesound, 50, 1)
|
||||
else if(istype(I, /obj/item/stack))
|
||||
return I.use_tool(holder, user, 0, volume=50, amount=5)
|
||||
|
||||
else if(istype(used_atom, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = used_atom
|
||||
if (C.use(4))
|
||||
playsound(holder, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
else
|
||||
to_chat(user, ("<span class='warning'>There's not enough cable to finish the task!</span>"))
|
||||
return FALSE
|
||||
else if(istype(used_atom, /obj/item/stack))
|
||||
var/obj/item/stack/S = used_atom
|
||||
if(S.get_amount() < 5)
|
||||
to_chat(user, ("<span class='warning'>There's not enough material in this stack!</span>"))
|
||||
return FALSE
|
||||
else
|
||||
S.use(5)
|
||||
return TRUE
|
||||
|
||||
|
||||
|
||||
@@ -240,9 +240,8 @@
|
||||
|
||||
else if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
var/obj/item/weldingtool/WT = W
|
||||
if(obj_integrity<max_integrity)
|
||||
if(WT.remove_fuel(1, user))
|
||||
if(obj_integrity < max_integrity)
|
||||
if(W.use_tool(src, user, 0, volume=50, amount=1))
|
||||
if (internal_damage & MECHA_INT_TANK_BREACH)
|
||||
clearInternalDamage(MECHA_INT_TANK_BREACH)
|
||||
to_chat(user, "<span class='notice'>You repair the damaged gas tank.</span>")
|
||||
@@ -251,9 +250,7 @@
|
||||
obj_integrity += min(10, max_integrity-obj_integrity)
|
||||
if(obj_integrity == max_integrity)
|
||||
to_chat(user, "<span class='notice'>It looks to be fully repaired now.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[WT] needs to be on for this task!</span>")
|
||||
return 1
|
||||
return 1
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The [name] is at full integrity!</span>")
|
||||
return 1
|
||||
|
||||
@@ -36,23 +36,24 @@
|
||||
|
||||
/obj/structure/mecha_wreckage/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/weldingtool))
|
||||
if(salvage_num <= 0)
|
||||
if(salvage_num <= 0 || !length(welder_salvage))
|
||||
to_chat(user, "<span class='warning'>You don't see anything that can be cut with [I]!</span>")
|
||||
return
|
||||
var/obj/item/weldingtool/WT = I
|
||||
if(welder_salvage && welder_salvage.len && WT.remove_fuel(0, user))
|
||||
var/type = prob(70) ? pick(welder_salvage) : null
|
||||
if(type)
|
||||
var/N = new type(get_turf(user))
|
||||
user.visible_message("[user] cuts [N] from [src].", "<span class='notice'>You cut [N] from [src].</span>")
|
||||
if(istype(N, /obj/item/mecha_parts/part))
|
||||
welder_salvage -= type
|
||||
salvage_num--
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You fail to salvage anything valuable from [src]!</span>")
|
||||
else
|
||||
|
||||
if(!I.use_tool(src, user, 0, volume=50))
|
||||
return
|
||||
|
||||
var/type = prob(70) ? pick(welder_salvage) : null
|
||||
if(type)
|
||||
var/N = new type(get_turf(user))
|
||||
user.visible_message("[user] cuts [N] from [src].", "<span class='notice'>You cut [N] from [src].</span>")
|
||||
if(istype(N, /obj/item/mecha_parts/part))
|
||||
welder_salvage -= type
|
||||
salvage_num--
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You fail to salvage anything valuable from [src]!</span>")
|
||||
return
|
||||
|
||||
else if(istype(I, /obj/item/wirecutters))
|
||||
if(salvage_num <= 0)
|
||||
to_chat(user, "<span class='warning'>You don't see anything that can be cut with [I]!</span>")
|
||||
|
||||
Reference in New Issue
Block a user