mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-25 17:02:04 +00:00
* LINDA -> MILLA * Tiles now change their atmos mode properly. * Fixed a bug that made walls generate supercold air when deconstructed/destroyed. * Apply suggestions from code review Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com> Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> * Begone, var! * MILLA -> milla * Lint. * More lint. * Prevent negative/NaN atmos from spreading. * Made fires start more reliably. * Undef what the rest should not see. * Enums are nice. * Match LINDA better. * Debugging verbs. * Debug verb fixes. * Labelled more lavaland stuff with ATMOS_MODE_LAVALAND * Block superconductivity on a couple more things for Lavaland. * Updated milla.dll * Lavaland map fixes. * Missed a spot. * Begone, var! (again) * Add libmilla_ci.so for continuous integration tests. * Install/contributing instructions for MILLA. * Directional plasmaglass windows on shuttles shouldn't stop protecting from heat after moving. * Banish bad naming. * Better naming and debug stats for SSair. * Apply suggestions from code review Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> * Magic numbers and formatting. * Don't screw up the temperature during reactions. * Efficiency and readability. * Fix hotspots. * Removed redundant safety (MILLA will already output an error) * Optimizations. * oops * TGS build script update. * Change API of gas_mixture and how you get one from a turf. * Get in there. * so many vars * MILLA binary updates. * Lint * Made MT cost more honest. * Gave MILLA a read-only mode. * More read-only vs synchronized mode work. * Even more. * Synchronize disposals. * Updated a bunch of stuff to use SSair.synchronize or GM.synchronize. * MILLA <3 Tracy * lint * cargo fmt * more lint * Test needed MILLA sync. * Silence atmos machinery that's behaving as intended, but continue objecting to other potential failures to synchronize. * Push new MILLA DLL * Build MILLA * Update PR instructions for MILLA. * Add some fancy plasmaglass windows to the Lifebringers' ship. * The golems remembered that they should insulate *all* their engines. * First round of TM bugfixes. * Build MILLA * fix two lavaland ruin turf types * bunch more maps * fixes milla ci and makes the interesting turf verb better * Solid turfs can no longer conduct heat (for now...) * Made indoor tiles in beach and winter biodomes not lavaland air. * Re-added random IT teleport, adjusted warning message * Fixed a tinted window on Lavaland to be a plasglass window instead. * Made firelocks and holofans heatproof * Made RPD auto-wrench pipes if you have a wrench in your offhand. * Runtime fixes. * Made visuals update more reliably. * Lint * Update .github/CONTRIBUTING.md Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> * Build MILLA * The Syndicate have installed tiny fans on their research base. * The syndicate have figured out how to make plastitanium windows heatproof. * This is getting out of hand. Now there are two of them. * Un-break the auto-wrenching that I broke before committing. * Build MILLA * Build MILLA * Massive MILLA refactor, assorted bugfixes. * Build MILLA * Explicit typing. * Less sleeping/blocking. * Build MILLA * Yes, yes, this part can sleep. * Build MILLA * SSair reporting improvements. * Build MILLA * Please do not dock twice and splat yourself. * Build MILLA * Pls to not make SM go nuts. * Build MILLA * Build MILLA * Added stricter lower bounds on plasmafire, fixing perpetually-burning SM. * Build MILLA * Lint * Temporary logging, begone. * Build MILLA * Prevent hotspot strobing. * Add in radiate_to_spess behavior. * Build MILLA * progress * Compiling is good. * bugfixes * Progress. * Ruins update. * This one exists. * Fixup temporary hotspots to last longer than one tick. * Add/fix comments. * Cut the slash. * Fix test. * No sleep for you. * Build MILLA * Prevent nested MILLA safety from runtiming. * Build MILLA * Runtime fix. * Build MILLA * Fix canisters not updating icon when gas contents change. * Build MILLA * Build MILLA * Fixed an issue that made mechs very cold on environment air. * Build MILLA * oops * Build MILLA * Walls can make loud noises again. * Build MILLA * Fixes a rare runtime. * Build MILLA * Update .github/DOWNLOADING.md Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> * Review suggestions * Lint * Build MILLA * bound_mixtures now only contains mixtures that can be written * Build MILLA * Apply suggestions from code review Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com> Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> * Build MILLA * Restore the original async behavior of pyro anomalies. * Build MILLA * Build MILLA * Make the safety assertion in /datum/milla_safe safer. * Build MILLA --------- Signed-off-by: Charlie Nolan <funnyman3595@gmail.com> Co-authored-by: FunnyMan3595 (Charlie Nolan) <funnyman@google.com> Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com> Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Co-authored-by: paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com> Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Co-authored-by: GDN <Roanrichards1@Gmail.com>
272 lines
7.7 KiB
Plaintext
272 lines
7.7 KiB
Plaintext
/obj/item/flamethrower
|
|
name = "flamethrower"
|
|
desc = "You are a firestarter!"
|
|
icon = 'icons/obj/flamethrower.dmi'
|
|
icon_state = "flamethrowerbase"
|
|
item_state = "flamethrower_0"
|
|
lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/guns_righthand.dmi'
|
|
flags = CONDUCT
|
|
force = 3
|
|
throwforce = 10
|
|
throw_speed = 1
|
|
throw_range = 5
|
|
w_class = WEIGHT_CLASS_NORMAL
|
|
materials = list(MAT_METAL = 5000)
|
|
resistance_flags = FIRE_PROOF
|
|
origin_tech = "combat=1;plasmatech=2;engineering=2"
|
|
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/internals/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)
|
|
return ..()
|
|
|
|
|
|
/obj/item/flamethrower/process()
|
|
if(!lit || !igniter)
|
|
STOP_PROCESSING(SSobj, src)
|
|
return null
|
|
var/turf/location = loc
|
|
if(ismob(location))
|
|
var/mob/M = location
|
|
if(M.is_holding(src))
|
|
location = M.loc
|
|
if(isturf(location)) //start a fire if possible
|
|
igniter.flamethrower_process(location)
|
|
|
|
|
|
/obj/item/flamethrower/update_icon_state()
|
|
if(lit)
|
|
item_state = "flamethrower_1"
|
|
else
|
|
item_state = "flamethrower_0"
|
|
if(ismob(loc))
|
|
var/mob/M = loc
|
|
M.update_inv_l_hand()
|
|
M.update_inv_r_hand()
|
|
|
|
/obj/item/flamethrower/update_overlays()
|
|
. = ..()
|
|
if(igniter)
|
|
. += "+igniter[status]"
|
|
if(ptank)
|
|
. += "+ptank"
|
|
if(lit)
|
|
. += "+lit"
|
|
|
|
/obj/item/flamethrower/can_enter_storage(obj/item/storage/S, mob/user)
|
|
if(lit)
|
|
to_chat(user, "<span class='warning'>[S] can't hold [src] while it's lit!</span>")
|
|
return FALSE
|
|
else
|
|
return TRUE
|
|
|
|
/obj/item/flamethrower/afterattack(atom/target, mob/user, flag)
|
|
. = ..()
|
|
if(flag)
|
|
return // too close
|
|
if(!user)
|
|
return
|
|
if(user.mind?.martial_art?.no_guns)
|
|
to_chat(user, "<span class='warning'>[user.mind.martial_art.no_guns_message]</span>")
|
|
return
|
|
if(HAS_TRAIT(user, TRAIT_CHUNKYFINGERS))
|
|
to_chat(user, "<span class='warning'>Your meaty finger is far too large for the trigger guard!</span>")
|
|
return
|
|
if(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 = get_line(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/I, mob/user, params)
|
|
if(isigniter(I))
|
|
var/obj/item/assembly/igniter/IG = I
|
|
if(IG.secured)
|
|
return
|
|
if(igniter)
|
|
return
|
|
if(!user.drop_item())
|
|
return
|
|
IG.forceMove(src)
|
|
igniter = IG
|
|
update_icon()
|
|
return
|
|
|
|
else if(istype(I, /obj/item/tank/internals/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
|
|
return ..()
|
|
|
|
/obj/item/flamethrower/wrench_act(mob/user, obj/item/I)
|
|
if(status)
|
|
return
|
|
. = TRUE
|
|
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
|
|
return
|
|
var/turf/T = get_turf(src)
|
|
if(weldtool)
|
|
weldtool.forceMove(T)
|
|
weldtool = null
|
|
if(igniter)
|
|
igniter.forceMove(T)
|
|
igniter = null
|
|
if(ptank)
|
|
ptank.forceMove(T)
|
|
ptank = null
|
|
new /obj/item/stack/rods(T)
|
|
qdel(src)
|
|
|
|
/obj/item/flamethrower/screwdriver_act(mob/user, obj/item/I)
|
|
if(!igniter || lit)
|
|
return
|
|
. = TRUE
|
|
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
|
|
return
|
|
status = !status
|
|
to_chat(user, "<span class='notice'>[igniter] is now [status ? "secured" : "unsecured"]!</span>")
|
|
update_icon()
|
|
|
|
/obj/item/flamethrower/return_analyzable_air()
|
|
if(ptank)
|
|
return ptank.return_analyzable_air()
|
|
return null
|
|
|
|
/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)
|
|
. = ..()
|
|
if(ptank)
|
|
. += "<span class='notice'>[src] has \a [ptank] attached. Alt-click to remove it.</span>"
|
|
|
|
/obj/item/flamethrower/proc/toggle_igniter(mob/user)
|
|
if(!ptank)
|
|
to_chat(user, "<span class='notice'>Attach a plasma tank first!</span>")
|
|
return
|
|
if(!status)
|
|
to_chat(user, "<span class='notice'>Secure the igniter first!</span>")
|
|
return
|
|
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()
|
|
|
|
/obj/item/flamethrower/CheckParts(list/parts_list)
|
|
..()
|
|
weldtool = locate(/obj/item/weldingtool) in contents
|
|
igniter = locate(/obj/item/assembly/igniter) in contents
|
|
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 = TRUE
|
|
var/turf/previousturf = get_turf(src)
|
|
for(var/turf/simulated/T in turflist)
|
|
if(T.blocks_air)
|
|
break
|
|
if(T == previousturf)
|
|
continue //so we don't burn the tile we be standin on
|
|
if(!T.CanAtmosPass(get_dir(T, previousturf)) || !previousturf.CanAtmosPass(get_dir(previousturf, T)))
|
|
break
|
|
if(igniter)
|
|
igniter.ignite_turf(src, T)
|
|
else
|
|
default_ignite(T)
|
|
sleep(1)
|
|
previousturf = T
|
|
operating = FALSE
|
|
for(var/mob/M in viewers(1, loc))
|
|
if(M.client && M.machine == src)
|
|
attack_self(M)
|
|
|
|
|
|
/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)
|
|
if(air_transfer.toxins())
|
|
air_transfer.set_toxins(air_transfer.toxins() * 5)
|
|
target.blind_release_air(air_transfer)
|
|
target.hotspot_expose((ptank.air_contents.temperature() * 2) + 380, 500)
|
|
|
|
|
|
/obj/item/flamethrower/Initialize(mapload)
|
|
. = ..()
|
|
if(create_full)
|
|
if(!weldtool)
|
|
weldtool = new /obj/item/weldingtool(src)
|
|
if(!igniter)
|
|
igniter = new igniter_type(src)
|
|
igniter.secured = FALSE
|
|
status = TRUE
|
|
if(create_with_tank)
|
|
ptank = new /obj/item/tank/internals/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)
|
|
var/obj/item/projectile/P = hitby
|
|
if(damage && attack_type == PROJECTILE_ATTACK && P.damage_type != STAMINA && 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)]")
|
|
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)
|