Files
Paradise/code/modules/power/cell.dm
BiancaWilkson 036b8e0182 Mindflayers v0.9, Playable Edition! (#26596)
* adds antaghud icon

* TGUI bundle build dont push changes i didnt stage challenge 2025 (IMPOSSIBLE)

* Adds organ repair passive

* Description fix

* Runs prettier

* Fixes desc 2

* Fix revert

* Remove vamp text

* Fix some CI + Partial refactor

* Fixes CI

* Fixes gamemodes I messed with

* Moves these procs over

* Description fix again

* Add back limit requiring drainees to have ckeys

* Adds terminator icon

* Update code/datums/status_effects/buffs.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/modules/surgery/organs/augments_internal.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/powers/flayer_stealth_powers.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* More lewv review

* Clamps the EMP severity

* Fixes "surveilance" typos

* The TODO is gone and can't hurt me anymore

* Update code/modules/antagonists/mind_flayer/flayer_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/game/objects/items/weapons/pneumaticCannon.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/game/objects/items/weapons/stunbaton.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* More lewc reviews

* Update code/modules/antagonists/_common/antag_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/_common/antag_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/flayer_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/flayer_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/flayer_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/flayer_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/flayer_power.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Fixes some camera bug issues + lewc reviews

* Update code/modules/antagonists/mind_flayer/powers/flayer_passives.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/flayer_power.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Updates a comment and fixes whitespace

* Autodocs flayerprod

* Update code/modules/antagonists/mind_flayer/powers/flayer_mobility_powers.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* qdel things we dont need anymore + typing an argument of add_abillity

* Remove debug log

* Update code/modules/antagonists/mind_flayer/flayer_power.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Slightly buffs, and fixes GC issues of tether

* I no longer feel i am a mindflayer

* Fixes formatting of greeting

* Better greeting

* Worlds shittiest sprite

* Don't need this TODO anymore

* Fixes double description

* Changes the wording on the borg laws

* and bundle too

* The cannon uses shrapnel now

* Initial style changes

* Ratios for brain damage

* Adds a chemical to test for flayerism

* Fixes the brain damage ratios

* Abilities are purchasable again

* Updates TGUI properly

* im sorry linter

* Steam smoke

* Hi bundle

* Re-abstracts this proc post syndi orgs

* Fixes gamemode logic post cling round removal

* I WONT FORGET IT THIS TIME

* Fix name of steam ability

* I'm a fool

* Fixes processed passives + removes debug message

* Fixes updating abilities inside UI

* Better description for quicksilver form

* First part lewc review

* Remove debug thingy

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Fixes defines + GCs weapon spells

* We don't need this

* Eyes GC properly

* Update code/modules/antagonists/mind_flayer/powers/flayer_mobility_powers.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* adds better logging to the assimilate

* Adds parenthesis

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* TGUI Bundle Rebuild

* Fixes and Reworks TGUI

* Cleaner JS and Fixes

* adds anti-snitching clause to borg laws

* changes the span for the borg messages

* No holoparasites

* Puts baton silence in line with glare

* Fixes total_swarms_gathered

* Nuke old trait

* Gun no longer not stuck

* Rejuv clears delayed knockdown

* Some weapon ability fixes

* Makes radio enable timers not counterintuitive

* Fixes beepsky runtimes

* Makes naming more consistent

* Adds one-click-antag

* Adds the mind flayer toggle (doesn't technically work)

* Adds flayers to check_antagonist

* Gives IDs to the status effects

* Also this one

* Makes retracting work again if it's in your offhand

* Fixes pacification tech levels

* Grapple is a weapon ability now, nullifcation retracts implants

* Fixed descriptions

* Adds some pizzaz to torque enhancer

* This actually needs to be like this

* Moves a helper proc over to a helper proc file

* Extra admin visibility

* Nukes the wacky flayer mob

* Makes silicon administrative access more sane

* Terminator form better description

* Makes rejuv set stamina to 0

* Various price increases

* AAAAAAAAAAAAA

* Better feedback + logging on cyborg subversion

* Swarm purchase display (temp fix)

* Makes mindflayer sounds more silent

* UI improvements

* Various mindflayer fixes

* Typo

* More fixes

* Fixes innates from being stupid

* Forgot to add this check earlier

* Oh this is how you add things to the protolathe

* Changes some description and upgrade messages

* Allows you to drain people beyond your limit

* Fixes some weapon upgrade issues

* Fix CI

* Fixes some draining issues

* More UI Tweaks and QoL

* Fixes most of the issues

* text

* Fixes

* Adds a radio jamming option to intruder

* Gives obfusciation to jammer ability

* Small passive cleanup

* Fixes Search and Adds Ability Stages to UI

* Adds freebie abilities

* Restructuring chain and adding blackbox

* Tgui polish

* Small fix for traceroute

* Fixes one click antag

* Increases EMP resistance cost

* Changes the pneumatic cannon into a shotgun

* Slightly lower static

* Fixed innate building rendering in upgrades

* Fixes icon and description

* Consistency

* Punctuation fix.

* Quick reboot + terminator form synergy

* Adds safety deleting

* Fix level for torque

* Fixes a bad bug

* Update code/game/gamemodes/objective.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Aaaaaaaaaaa

* Makes torque a martial art and some martial arts safeties

* Replaces vortex arm with barrier

* Fix paths

* Adds torque knockdown

* Part 1 lewc review

* HIIIII SQUIDWARD I'M IN YOUR BRANCH NOW

* Removes flak cannon

* Flayer respects mindshielding now on vamp+cling

* Fixes EMP resist

* More fixes

* DGL review

* Contra review

* Clean up weapon powers

* Various tweaks

* Borg hand slight improvements

* Parent call needs to be after this

* Fixes stuff

* Adds a new proc that is called when a spell is purchased

* NEW SPRITES WOOOO

* Traceroute update

* Slightly lower traceroute cost

* Formatting

* Oops

* Wow this could've been bad

* Overclock small buff

* Reduces cost of 1st level EMP immunity

* Lewc review

* TGUI Bundle Rebuild

* Fix barricades

* Lewc review

* Okay FINE qwerty I'll change this

* Traceroute thingy

* I am an idiot

* First part

* Lewc review

* Forgor  this one

* Last bits

* Update code/game/objects/items/control_wand.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/powers/flayer_mobility_powers.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Null

* Static-ness

* Update code/game/gamemodes/changeling/traitor_chan.dm

Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/__DEFINES/mindflayer_defines.dm

Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Last bits

---------

Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>
Co-authored-by: DGamerL <daan.lyklema@gmail.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
2024-10-30 18:35:29 +00:00

385 lines
10 KiB
Plaintext

/obj/item/stock_parts/cell
name = "power cell"
desc = "A rechargeable electrochemical power cell."
icon = 'icons/obj/power.dmi'
icon_state = "cell"
item_state = "cell"
origin_tech = "powerstorage=1"
force = 5
throwforce = 5
throw_speed = 2
throw_range = 5
w_class = WEIGHT_CLASS_SMALL
/// Battery's current state of charge (kilojoules)
var/charge = 0
/// Battery's maximum state of charge (kilojoules)
var/maxcharge = 1000
/// How much energy the cell starts with (kilojoules)
var/starting_charge
materials = list(MAT_METAL = 700, MAT_GLASS = 50)
///If the battery will explode
var/rigged = FALSE
/// How much energy is given to a recharging cell every tick (kilojoules / tick)
var/chargerate = 100
///Whether it will recharge automatically
var/self_recharge = FALSE
///Whether the description will include the maxcharge
var/ratingdesc = TRUE
///Additional overlay to signify battery being organic
var/grown_battery = FALSE
/obj/item/stock_parts/cell/get_cell()
return src
/obj/item/stock_parts/cell/New()
..()
START_PROCESSING(SSobj, src)
charge = !isnull(starting_charge) ? starting_charge : maxcharge
if(ratingdesc)
// State of charge is in kJ so we multiply it by 1000 to get Joules
desc += " This one has a power rating of [DisplayJoules(maxcharge * 1000)], and you should not swallow it."
update_icon(UPDATE_OVERLAYS)
/obj/item/stock_parts/cell/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/stock_parts/cell/vv_edit_var(var_name, var_value)
switch(var_name)
if("self_recharge")
if(var_value)
START_PROCESSING(SSobj, src)
else
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/item/stock_parts/cell/process()
if(self_recharge)
give(chargerate * 0.25)
else
return PROCESS_KILL
/obj/item/stock_parts/cell/update_overlays()
. = ..()
if(grown_battery)
. += image('icons/obj/power.dmi', "grown_wires")
if(charge < 0.01)
return
else if(charge/maxcharge >=0.995)
. += "cell-o2"
else
. += "cell-o1"
/obj/item/stock_parts/cell/proc/percent() // return % charge of cell
return 100 * charge / maxcharge
// use power from a cell
/obj/item/stock_parts/cell/use(amount)
if(rigged && amount > 0)
explode()
return 0
if(charge < amount)
return 0
charge = (charge - amount)
return 1
// recharge the cell
/obj/item/stock_parts/cell/proc/give(amount)
if(rigged && amount > 0)
explode()
return 0
if(maxcharge < amount)
amount = maxcharge
var/power_used = min(maxcharge - charge, amount)
charge += power_used
return power_used
/obj/item/stock_parts/cell/examine(mob/user)
. = ..()
if(rigged)
. += "<span class='danger'>This power cell seems to be faulty!</span>"
else
. += "The charge meter reads [round(percent() )]%."
/obj/item/stock_parts/cell/suicide_act(mob/user)
to_chat(viewers(user), "<span class='suicide'>[user] is licking the electrodes of [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return FIRELOSS
/obj/item/stock_parts/cell/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/reagent_containers/syringe))
var/obj/item/reagent_containers/syringe/S = W
if(S.reagents.has_reagent("plasma", 5) || S.reagents.has_reagent("plasma_dust", 5))
to_chat(user, "You inject the solution into the power cell.")
rigged = TRUE
log_admin("LOG: [key_name(user)] injected a power cell with plasma, rigging it to explode.")
message_admins("LOG: [key_name_admin(user)] injected a power cell with plasma, rigging it to explode.")
S.reagents.clear_reagents()
else
return ..()
/obj/item/stock_parts/cell/proc/explode()
var/turf/T = get_turf(loc)
if(charge == 0)
return
var/devastation_range = -1 //round(charge/11000)
var/heavy_impact_range = round(sqrt(charge) / 60)
var/light_impact_range = round(sqrt(charge) / 30)
var/flash_range = light_impact_range
if(light_impact_range == 0)
rigged = FALSE
corrupt()
return
//explosion(T, 0, 1, 2, 2)
log_admin("LOG: Rigged power cell explosion, last touched by [fingerprintslast]")
message_admins("LOG: Rigged power cell explosion, last touched by [fingerprintslast]")
explosion(T, devastation_range, heavy_impact_range, light_impact_range, flash_range)
charge = 0 //Extra safety in the event the cell does not QDEL right
qdel(src)
/obj/item/stock_parts/cell/proc/corrupt()
charge /= 2
maxcharge = max(maxcharge / 2, chargerate)
if(prob(10))
rigged = TRUE //broken batterys are dangerous
/obj/item/stock_parts/cell/emp_act(severity)
charge -= 1000 / severity
if(charge < 0)
charge = 0
..()
/obj/item/stock_parts/cell/ex_act(severity)
..()
if(!QDELETED(src))
switch(severity)
if(2)
if(prob(50))
corrupt()
if(3)
if(prob(25))
corrupt()
/obj/item/stock_parts/cell/blob_act(obj/structure/blob/B)
ex_act(EXPLODE_DEVASTATE)
/obj/item/stock_parts/cell/proc/get_electrocute_damage()
if(charge >= 1000)
return clamp(20 + round(charge / 25000), 20, 195) + rand(-5, 5)
else
return 0
// Cell variants
/obj/item/stock_parts/cell/empty
starting_charge = 0
/obj/item/stock_parts/cell/crap
name = "\improper Nanotrasen brand rechargeable AA battery"
desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT
maxcharge = 500
materials = list(MAT_GLASS = 40)
rating = 2
/obj/item/stock_parts/cell/crap/empty
starting_charge = 0
/obj/item/stock_parts/cell/upgraded
name = "upgraded power cell"
desc = "A power cell with a slightly higher capacity than normal!"
maxcharge = 2500
materials = list(MAT_GLASS = 50)
rating = 2
chargerate = 1000
/obj/item/stock_parts/cell/upgraded/plus
name = "upgraded power cell+"
desc = "A power cell with an even higher capacity than the base model!"
maxcharge = 5000
/obj/item/stock_parts/cell/secborg
name = "security borg rechargeable D battery"
origin_tech = null
maxcharge = 600 //600 max charge / 100 charge per shot = six shots
materials = list(MAT_GLASS = 40)
rating = 2.5
/obj/item/stock_parts/cell/secborg/empty
starting_charge = 0
/obj/item/stock_parts/cell/hos_gun
name = "\improper X-01 multiphase energy gun power cell"
maxcharge = 1200
/// 200 pulse shots
/obj/item/stock_parts/cell/pulse
name = "pulse rifle power cell"
maxcharge = 40000
rating = 3
chargerate = 1500
/// 25 pulse shots
/obj/item/stock_parts/cell/pulse/carbine
name = "pulse carbine power cell"
maxcharge = 5000
/// 10 pulse shots
/obj/item/stock_parts/cell/pulse/pistol
name = "pulse pistol power cell"
maxcharge = 2000
/obj/item/stock_parts/cell/high
name = "high-capacity power cell"
origin_tech = "powerstorage=2"
icon_state = "hcell"
maxcharge = 10000
materials = list(MAT_GLASS = 60)
rating = 3
chargerate = 1500
/obj/item/stock_parts/cell/high/plus
name = "high-capacity power cell+"
desc = "Where did these come from?"
icon_state = "h+cell"
maxcharge = 15000
chargerate = 2250
/obj/item/stock_parts/cell/high/empty
starting_charge = 0
/obj/item/stock_parts/cell/super
name = "super-capacity power cell"
origin_tech = "powerstorage=3;materials=3"
icon_state = "scell"
maxcharge = 20000
materials = list(MAT_GLASS = 300)
rating = 4
chargerate = 2000
/obj/item/stock_parts/cell/super/empty
starting_charge = 0
/obj/item/stock_parts/cell/hyper
name = "hyper-capacity power cell"
origin_tech = "powerstorage=4;engineering=4;materials=4"
icon_state = "hpcell"
maxcharge = 30000
materials = list(MAT_GLASS = 400)
rating = 5
chargerate = 3000
/obj/item/stock_parts/cell/hyper/empty
starting_charge = 0
/obj/item/stock_parts/cell/bluespace
name = "bluespace power cell"
desc = "A rechargeable transdimensional power cell."
origin_tech = "powerstorage=5;bluespace=4;materials=4;engineering=4"
icon_state = "bscell"
maxcharge = 40000
materials = list(MAT_GLASS = 600)
rating = 6
chargerate = 4000
/obj/item/stock_parts/cell/bluespace/empty
starting_charge = 0
/obj/item/stock_parts/cell/bluespace/charging
name = "self-charging bluespace power cell"
desc = "An experimental, self-charging, transdimensional power cell."
origin_tech = "powerstorage=10;bluespace=10"
self_recharge = TRUE
/obj/item/stock_parts/cell/bluespace/trapped
rigged = TRUE
/obj/item/stock_parts/cell/infinite
name = "infinite-capacity power cell!"
icon_state = "icell"
origin_tech = "powerstorage=7"
maxcharge = 30000
materials = list(MAT_GLASS=1000)
rating = 6
chargerate = 30000
/obj/item/stock_parts/cell/infinite/use()
return TRUE
/obj/item/stock_parts/cell/infinite/abductor
name = "void core"
desc = "An alien power cell that produces energy seemingly out of nowhere."
icon = 'icons/obj/abductor.dmi'
icon_state = "cell"
maxcharge = 50000
rating = 12
ratingdesc = FALSE
/obj/item/stock_parts/cell/infinite/abductor/update_overlays()
return list()
/obj/item/stock_parts/cell/potato
name = "potato battery"
desc = "A rechargeable starch based power cell."
icon = 'icons/obj/hydroponics/harvest.dmi'
icon_state = "potato"
origin_tech = "powerstorage=1;biotech=1"
charge = 100
maxcharge = 300
materials = list()
rating = 1
grown_battery = TRUE //it has the overlays for wires
/obj/item/stock_parts/cell/high/slime
name = "charged slime core"
desc = "A yellow slime core infused with plasma, it crackles with power."
origin_tech = "powerstorage=5;biotech=4"
icon = 'icons/mob/slimes.dmi'
icon_state = "yellow slime extract"
materials = list()
rating = 5 //self-recharge makes these desirable
self_recharge = 1 // Infused slime cores self-recharge, over time
chargerate = 500
/obj/item/stock_parts/cell/emproof
name = "\improper EMP-proof cell"
desc = "An EMP-proof cell."
maxcharge = 500
rating = 3
/obj/item/stock_parts/cell/emproof/empty
starting_charge = 0
/obj/item/stock_parts/cell/emproof/emp_act(severity)
return
/obj/item/stock_parts/cell/emproof/corrupt()
return
/obj/item/stock_parts/cell/ninja
name = "spider-clan power cell"
desc = "A standard ninja-suit power cell."
maxcharge = 10000
materials = list(MAT_GLASS = 60)
/obj/item/stock_parts/cell/bsg
name = "\improper B.S.G power cell"
desc = "A high capacity, slow charging cell for the B.S.G."
maxcharge = 40000
chargerate = 2600 // about 30 seconds to charge with a default recharger
/// EMP proof so emp_act does not double dip.
/obj/item/stock_parts/cell/emproof/reactive
name = "reactive armor power cell"
desc = "A cell used to power reactive armors."
maxcharge = 2400
/obj/item/stock_parts/cell/flayerprod
name = "mind flayer internal cell"
desc = "you shouldn't be seeing this, contact a coder"
maxcharge = 4000
self_recharge = TRUE
chargerate = 200 //This self charges it 50 power per tick at the base level