Deconflict

This commit is contained in:
variableundefined
2019-09-11 23:00:13 -04:00
122 changed files with 1161 additions and 846 deletions
+127 -104
View File
@@ -7,32 +7,35 @@
lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/guns_righthand.dmi'
flags = CONDUCT
force = 3.0
throwforce = 10.0
force = 3
throwforce = 10
throw_speed = 1
throw_range = 5
w_class = WEIGHT_CLASS_NORMAL
materials = list(MAT_METAL=500)
origin_tech = "combat=1;plasmatech=2;engineering=2"
var/status = 0
var/lit = 0 //on or off
var/operating = 0//cooldown
var/turf/previousturf = null
var/status = FALSE
var/lit = FALSE //on or off
var/operating = FALSE//cooldown
var/obj/item/weldingtool/weldtool = null
var/obj/item/assembly/igniter/igniter = null
var/obj/item/tank/plasma/ptank = null
var/warned_admins = FALSE //for the message_admins() when lit
//variables for prebuilt flamethrowers
var/create_full = FALSE
var/create_with_tank = FALSE
var/igniter_type = /obj/item/assembly/igniter
/obj/item/flamethrower/Destroy()
QDEL_NULL(weldtool)
QDEL_NULL(igniter)
QDEL_NULL(ptank)
previousturf = null
return ..()
/obj/item/flamethrower/process()
if(!lit)
if(!lit || !igniter)
STOP_PROCESSING(SSobj, src)
return null
var/turf/location = loc
@@ -41,133 +44,139 @@
if(M.l_hand == src || M.r_hand == src)
location = M.loc
if(isturf(location)) //start a fire if possible
location.hotspot_expose(700, 2)
return
igniter.flamethrower_process(location)
/obj/item/flamethrower/update_icon()
overlays.Cut()
cut_overlays()
if(igniter)
overlays += "+igniter[status]"
add_overlay("+igniter[status]")
if(ptank)
overlays += "+ptank"
add_overlay("+ptank")
if(lit)
overlays += "+lit"
add_overlay("+lit")
item_state = "flamethrower_1"
else
item_state = "flamethrower_0"
return
if(ismob(loc))
var/mob/M = loc
M.update_inv_l_hand()
M.update_inv_r_hand()
/obj/item/flamethrower/afterattack(atom/target, mob/user, flag)
if(flag) return // too close
// Make sure our user is still holding us
if(user && user.is_in_active_hand(src))
. = ..()
if(flag)
return // too close
if(user && user.get_active_hand() == src) // Make sure our user is still holding us
var/turf/target_turf = get_turf(target)
if(target_turf)
var/turflist = getline(user, target_turf)
add_attack_logs(user, target, "Flamethrowered at [target.x],[target.y],[target.z]")
flame_turf(turflist)
/obj/item/flamethrower/attackby(obj/item/W as obj, mob/user as mob, params)
if(user.stat || user.restrained() || user.lying) return
if(iswrench(W) && !status)//Taking this apart
/obj/item/flamethrower/attackby(obj/item/I, mob/user, params)
if(iswrench(I) && !status)//Taking this apart
var/turf/T = get_turf(src)
if(weldtool)
weldtool.loc = T
weldtool.forceMove(T)
weldtool = null
if(igniter)
igniter.loc = T
igniter.forceMove(T)
igniter = null
if(ptank)
ptank.loc = T
ptank.forceMove(T)
ptank = null
new /obj/item/stack/rods(T)
qdel(src)
return
if(isscrewdriver(W) && igniter && !lit)
else if(isscrewdriver(I) && igniter && !lit)
status = !status
to_chat(user, "<span class='notice'>[igniter] is now [status ? "secured" : "unsecured"]!</span>")
update_icon()
return
if(isigniter(W))
var/obj/item/assembly/igniter/I = W
if(I.secured) return
if(igniter) return
user.drop_item()
I.loc = src
igniter = I
update_icon()
return
if(istype(W,/obj/item/tank/plasma))
if(ptank)
to_chat(user, "<span class='notice'>There appears to already be a plasma tank loaded in [src]!</span>")
else if(isigniter(I))
var/obj/item/assembly/igniter/IG = I
if(IG.secured)
return
user.drop_item()
ptank = W
W.loc = src
if(igniter)
return
if(!user.drop_item())
return
IG.forceMove(src)
igniter = IG
update_icon()
return
if(istype(W, /obj/item/analyzer) && ptank)
else if(istype(I, /obj/item/tank/plasma))
if(ptank)
if(user.drop_item())
I.forceMove(src)
ptank.forceMove(get_turf(src))
ptank = I
to_chat(user, "<span class='notice'>You swap the plasma tank in [src]!</span>")
return
if(!user.drop_item())
return
I.forceMove(src)
ptank = I
update_icon()
return
else if(istype(I, /obj/item/analyzer) && ptank)
atmosanalyzer_scan(ptank.air_contents, user)
else
return ..()
/obj/item/flamethrower/attack_self(mob/user)
toggle_igniter(user)
/obj/item/flamethrower/AltClick(mob/user)
if(ptank && isliving(user) && user.Adjacent(src))
user.put_in_hands(ptank)
ptank = null
to_chat(user, "<span class='notice'>You remove the plasma tank from [src]!</span>")
update_icon()
/obj/item/flamethrower/examine(mob/user)
..()
return
if(ptank)
to_chat(user, "<span class='notice'>[src] has \a [ptank] attached. Alt-click to remove it.</span>")
/obj/item/flamethrower/attack_self(mob/user as mob)
if(user.stat || user.restrained() || user.lying) return
user.set_machine(src)
/obj/item/flamethrower/proc/toggle_igniter(mob/user)
if(!ptank)
to_chat(user, "<span class='notice'>Attach a plasma tank first!</span>")
return
var/dat = text("<TT><B>Flamethrower (<A HREF='?src=[UID()];light=1'>[lit ? "<font color='red'>Lit</font>" : "Unlit"]</a>)</B><BR>\n Tank Pressure: [ptank.air_contents.return_pressure()]<BR>\n<A HREF='?src=[UID()];remove=1'>Remove plasmatank</A> - <A HREF='?src=[UID()];close=1'>Close</A></TT>")
user << browse(dat, "window=flamethrower;size=600x300")
onclose(user, "flamethrower")
return
/obj/item/flamethrower/Topic(href,href_list[])
if(href_list["close"])
usr.unset_machine()
usr << browse(null, "window=flamethrower")
if(!status)
to_chat(user, "<span class='notice'>Secure the igniter first!</span>")
return
if(usr.stat || usr.restrained() || usr.lying) return
usr.set_machine(src)
if(href_list["light"])
if(!ptank) return
if(!status) return
lit = !lit
if(lit)
START_PROCESSING(SSobj, src)
if(href_list["remove"])
if(!ptank) return
usr.put_in_hands(ptank)
ptank = null
lit = 0
usr.unset_machine()
usr << browse(null, "window=flamethrower")
for(var/mob/M in viewers(1, loc))
if((M.client && M.machine == src))
attack_self(M)
to_chat(user, "<span class='notice'>You [lit ? "extinguish" : "ignite"] [src]!</span>")
lit = !lit
if(lit)
START_PROCESSING(SSobj, src)
if(!warned_admins)
message_admins("[ADMIN_LOOKUPFLW(user)] has lit a flamethrower.")
warned_admins = TRUE
else
STOP_PROCESSING(SSobj,src)
update_icon()
return
/obj/item/flamethrower/CheckParts(list/parts_list)
..()
weldtool = locate(/obj/item/weldingtool) in contents
igniter = locate(/obj/item/assembly/igniter) in contents
weldtool.status = 0
igniter.secured = 0
status = 1
weldtool.status = FALSE
igniter.secured = FALSE
status = TRUE
update_icon()
//Called from turf.dm turf/dblclick
/obj/item/flamethrower/proc/flame_turf(turflist)
if(!lit || operating) return
operating = 1
if(!lit || operating)
return
operating = TRUE
var/turf/previousturf = get_turf(src)
for(var/turf/simulated/T in turflist)
if(!T.air)
@@ -176,48 +185,62 @@
continue //so we don't burn the tile we be standin on
if(!T.CanAtmosPass(previousturf))
break
ignite_turf(T)
if(igniter)
igniter.ignite_turf(src, T)
else
default_ignite(T)
sleep(1)
previousturf = T
operating = 0
operating = FALSE
for(var/mob/M in viewers(1, loc))
if((M.client && M.machine == src))
attack_self(M)
return
/obj/item/flamethrower/proc/ignite_turf(turf/target, release_amount = 0.05)
/obj/item/flamethrower/proc/default_ignite(turf/target, release_amount = 0.05)
//TODO: DEFERRED Consider checking to make sure tank pressure is high enough before doing this...
//Transfer 5% of current tank air contents to turf
var/datum/gas_mixture/air_transfer = ptank.air_contents.remove_ratio(release_amount)
air_transfer.toxins = air_transfer.toxins // This is me not comprehending the air system. I realize this is retarded and I could probably make it work without fucking it up like this, but there you have it. -- TLE
if(air_transfer.toxins)
air_transfer.toxins = air_transfer.toxins * 5
target.assume_air(air_transfer)
//Burn it based on transfered gas
target.hotspot_expose((ptank.air_contents.temperature*2) + 380,500) // -- More of my "how do I shot fire?" dickery. -- TLE
target.hotspot_expose((ptank.air_contents.temperature*2) + 380, 500)
//location.hotspot_expose(1000,500,1)
SSair.add_to_active(target, 0)
return
/obj/item/flamethrower/full/New(var/loc)
..()
if(!weldtool)
weldtool = new /obj/item/weldingtool(src)
weldtool.status = 0
if(!igniter)
igniter = new /obj/item/assembly/igniter(src)
igniter.secured = 0
status = 1
update_icon()
/obj/item/flamethrower/Initialize(mapload)
. = ..()
if(create_full)
if(!weldtool)
weldtool = new /obj/item/weldingtool(src)
weldtool.status = FALSE
if(!igniter)
igniter = new igniter_type(src)
igniter.secured = FALSE
status = TRUE
if(create_with_tank)
ptank = new /obj/item/tank/plasma/full(src)
update_icon()
/obj/item/flamethrower/full/tank/New(var/loc)
..()
ptank = new /obj/item/tank/plasma/full(src)
update_icon()
/obj/item/flamethrower/full
create_full = TRUE
/obj/item/flamethrower/full/tank
create_with_tank = TRUE
/obj/item/flamethrower/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(ptank && damage && attack_type == PROJECTILE_ATTACK && prob(15))
owner.visible_message("<span class='danger'>[attack_text] hits the fueltank on [owner]'s [src], rupturing it! What a shot!</span>")
var/turf/target_turf = get_turf(owner)
log_game("A projectile ([hitby]) detonated a flamethrower tank held by [key_name(owner)] at [COORD(target_turf)]")
ignite_turf(target_turf, 100)
qdel(ptank)
igniter.ignite_turf(src,target_turf, release_amount = 100)
QDEL_NULL(ptank)
return 1 //It hit the flamethrower, not them
/obj/item/assembly/igniter/proc/flamethrower_process(turf/simulated/location)
location.hotspot_expose(700, 2)
/obj/item/assembly/igniter/proc/ignite_turf(obj/item/flamethrower/F, turf/simulated/location, release_amount = 0.05)
F.default_ignite(location, release_amount)
+53 -62
View File
@@ -1,27 +1,30 @@
// Glass shards
/obj/item/shard
name = "glass shard"
name = "shard"
desc = "A nasty looking shard of glass."
icon = 'icons/obj/shards.dmi'
icon_state = "large"
sharp = TRUE
desc = "Could probably be used as ... a throwing weapon?"
w_class = WEIGHT_CLASS_TINY
force = 5
throwforce = 10
item_state = "shard-glass"
materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
materials = list(MAT_GLASS = MINERAL_MATERIAL_AMOUNT)
attack_verb = list("stabbed", "slashed", "sliced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'
armor = list("melee" = 100, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0)
sharp = TRUE
var/cooldown = 0
var/icon_prefix
var/obj/item/stack/sheet/welded_type = /obj/item/stack/sheet/glass
/obj/item/shard/suicide_act(mob/user)
to_chat(viewers(user), pick("<span class='danger'>[user] is slitting [user.p_their()] wrists with [src]! It looks like [user.p_theyre()] trying to commit suicide.</span>",
"<span class='danger'>[user] is slitting [user.p_their()] throat with [src]! It looks like [user.p_theyre()] trying to commit suicide.</span>"))
return BRUTELOSS
/obj/item/shard/New()
..()
/obj/item/shard/Initialize(mapload)
. = ..()
icon_state = pick("large", "medium", "small")
switch(icon_state)
if("small")
@@ -33,6 +36,8 @@
if("large")
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
if(icon_prefix)
icon_state = "[icon_prefix][icon_state]"
/obj/item/shard/afterattack(atom/movable/AM, mob/user, proximity)
if(!proximity || !(src in user))
@@ -48,15 +53,17 @@
if(affecting.is_robotic())
return
to_chat(H, "<span class='warning'>[src] cuts into your hand!</span>")
if(affecting.receive_damage(force*0.5))
if(affecting.receive_damage(force * 0.5))
H.UpdateDamageIcon()
/obj/item/shard/attackby(obj/item/I, mob/user, params)
if(iswelder(I))
var/obj/item/weldingtool/WT = I
if(WT.remove_fuel(0, user))
var/obj/item/stack/sheet/glass/NG = new (user.loc)
for(var/obj/item/stack/sheet/glass/G in user.loc)
var/obj/item/stack/sheet/NG = new welded_type(user.loc)
for(var/obj/item/stack/sheet/G in user.loc)
if(!istype(G, welded_type))
continue
if(G == NG)
continue
if(G.amount >= G.max_amount)
@@ -64,64 +71,48 @@
G.attackby(NG, user)
to_chat(user, "<span class='notice'>You add the newly-formed glass to the stack. It now contains [NG.amount] sheet\s.</span>")
qdel(src)
else
return ..()
return
if(istype(I, /obj/item/lightreplacer))
I.attackby(src, user)
return
return ..()
/obj/item/shard/Crossed(AM as mob|obj, oldloc)
if(isliving(AM))
var/mob/living/M = AM
if(M.incorporeal_move || M.flying || M.throwing)//you are incorporal or flying or being thrown ..no shard stepping!
/obj/item/shard/Crossed(mob/living/L, oldloc)
if(istype(L) && has_gravity(loc))
if(L.incorporeal_move || L.flying)
return
to_chat(M, "<span class='danger'>You step on \the [src]!</span>")
playsound(loc, 'sound/effects/glass_step.ogg', 50, 1) // not sure how to handle metal shards with sounds
if(ishuman(M))
var/mob/living/carbon/human/H = M
playsound(loc, 'sound/effects/glass_step.ogg', 50, TRUE)
if(ishuman(L))
var/mob/living/carbon/human/H = L
var/obj/item/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot"))
if(!affecting)
return
if(affecting.is_robotic())
return
var/feetCover = (H.wear_suit && H.wear_suit.body_parts_covered & FEET) || (H.w_uniform && H.w_uniform.body_parts_covered & FEET)
if(H.shoes || feetCover || H.buckled)
return
if(affecting.receive_damage(force, 0))
H.UpdateDamageIcon()
if( !H.shoes && ( !H.wear_suit || !(H.wear_suit.body_parts_covered & FEET) ) )
var/obj/item/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot"))
if(!affecting)
return
if(affecting.is_robotic())
return
H.Weaken(3)
if(affecting.receive_damage(5, 0))
H.UpdateDamageIcon()
..()
if(cooldown < world.time - 10) //cooldown to avoid message spam.
if(!H.incapacitated(ignore_restraints = TRUE))
H.visible_message("<span class='danger'>[H] steps on [src]!</span>", \
"<span class='userdanger'>You step on [src]!</span>")
else
H.visible_message("<span class='danger'>[H] slides on [src]!</span>", \
"<span class='userdanger'>You slide on [src]!</span>")
cooldown = world.time
H.Weaken(3)
return ..()
/obj/item/shard/plasma
name = "plasma shard"
desc = "A shard of plasma glass. Considerably tougher then normal glass shards. Apparently not tough enough to be a window."
force = 8
throwforce = 15
force = 6
throwforce = 11
icon_state = "plasmalarge"
sharp = TRUE
/obj/item/shard/plasma/New()
..()
icon_state = pick("plasmalarge", "plasmamedium", "plasmasmall")
switch(icon_state)
if("plasmasmall")
pixel_x = rand(-12, 12)
pixel_y = rand(-12, 12)
if("plasmamedium")
pixel_x = rand(-8, 8)
pixel_y = rand(-8, 8)
if("plasmalarge")
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
/obj/item/shard/plasma/attackby(obj/item/W, mob/user, params)
if(iswelder(W))
var/obj/item/weldingtool/WT = W
if(WT.remove_fuel(0, user))
var/obj/item/stack/sheet/plasmaglass/NG = new (user.loc)
for(var/obj/item/stack/sheet/plasmaglass/G in user.loc)
if(G == NG)
continue
if(G.amount >= G.max_amount)
continue
G.attackby(NG, user, params)
to_chat(usr, "You add the newly-formed plasma glass to the stack. It now contains [NG.amount] sheets.")
qdel(src)
else
return ..()
materials = list(MAT_PLASMA = MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS = MINERAL_MATERIAL_AMOUNT)
icon_prefix = "plasma"
welded_type = /obj/item/stack/sheet/plasmaglass
@@ -8,7 +8,7 @@
slot_flags = SLOT_BACK
hitsound = 'sound/weapons/smash.ogg'
w_class = WEIGHT_CLASS_NORMAL
pressure_resistance = ONE_ATMOSPHERE*5
pressure_resistance = ONE_ATMOSPHERE * 5
force = 5.0
throwforce = 10.0
throw_speed = 1
@@ -278,22 +278,22 @@
if(Adj)
return //Safety check so you don't blast yourself trying to refill your tank
var/datum/reagents/R = reagents
if(R.total_volume < 50)
to_chat(user, "You need at least 50 units of water to use the nanofrost launcher!")
if(R.total_volume < 100)
to_chat(user, "You need at least 100 units of water to use the nanofrost launcher!")
return
if(nanofrost_cooldown)
to_chat(user, "Nanofrost launcher is still recharging")
return
nanofrost_cooldown = 1
R.remove_any(50)
R.remove_any(100)
var/obj/effect/nanofrost_container/A = new /obj/effect/nanofrost_container(get_turf(src))
log_game("[key_name(user)] used Nanofrost at [get_area(user)] ([user.x], [user.y], [user.z]).")
playsound(src,'sound/items/syringeproj.ogg',40,1)
for(var/a=0, a<5, a++)
step_towards(A, target)
sleep(1)
sleep(2)
A.Smoke()
spawn(50)
spawn(100)
if(src)
nanofrost_cooldown = 0
return
+14 -7
View File
@@ -337,14 +337,23 @@
sharp = TRUE
no_spin_thrown = TRUE
var/obj/item/grenade/explosive = null
var/icon_prefix = "spearglass"
/obj/item/twohanded/spear/update_icon()
if(explosive)
icon_state = "spearbomb[wielded]"
else
icon_state = "spearglass[wielded]"
icon_state = "[icon_prefix][wielded]"
/obj/item/twohanded/spear/CheckParts(list/parts_list)
var/obj/item/shard/tip = locate() in parts_list
if(istype(tip, /obj/item/shard/plasma))
force_wielded = 19
force_unwielded = 11
throwforce = 21
icon_prefix = "spearplasma"
update_icon()
qdel(tip)
..()
/obj/item/twohanded/spear/afterattack(atom/movable/AM, mob/user, proximity)
if(!proximity)
return
@@ -370,9 +379,7 @@
force_wielded = 20 //I have no idea how to balance
throwforce = 22
armour_penetration = 15 //Enhanced armor piercing
/obj/item/twohanded/spear/bonespear/update_icon()
icon_state = "bone_spear[wielded]"
icon_prefix = "bone_spear"
//GREY TIDE
/obj/item/twohanded/spear/grey_tide
+6 -1
View File
@@ -105,7 +105,12 @@
..()
if(istype(I, /obj/item/shard))
var/obj/item/twohanded/spear/S = new /obj/item/twohanded/spear
if(istype(I, /obj/item/shard/plasma))
S.force_wielded = 19
S.force_unwielded = 11
S.throwforce = 21
S.icon_prefix = "spearplasma"
S.update_icon()
if(!remove_item_from_storage(user))
user.unEquip(src)
user.unEquip(I)