Skip to content

Commit

Permalink
venting, and more balance stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Pockets-byte committed Jun 9, 2024
1 parent 9b97e85 commit feb5d39
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
charge = 0
max_heat = 800
heat_per_shot = 200
heat_rate = 80
heat_rate = 30
storage_rate = 50


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
var/gun_id = 0 // Used for map linkage
max_heat = 1000
heat_per_shot = 80
heat_rate = 30
heat_rate = 15
storage_rate = 100


Expand Down
25 changes: 16 additions & 9 deletions nsv13/code/modules/munitions/ship_weapons/energy_weapons/phaser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
heat_rate = 10
var/storage_rate = 100
var/weapon_state = STATE_NOTHING
var/ventnumber = 1

/obj/machinery/ship_weapon/energy/beam
name = "phase cannon"
Expand All @@ -61,7 +62,7 @@
power_modifier_cap = 5 //Allows you to do insanely powerful oneshot lasers. Maximum theoretical damage of 500.
max_heat = 2000
heat_per_shot = 800
heat_rate = 90
heat_rate = 5
storage_rate = 140

/obj/machinery/ship_weapon/energy/Initialize()
Expand Down Expand Up @@ -94,6 +95,16 @@
ui.open()
ui.set_autoupdate(TRUE)

/obj/machinery/ship_weapon/energy/proc/vent()
if(heat > max_heat/4)
weapon_state = STATE_VENTING
ventnumber = max_heat - (3*(max_heat/4))
if(heat <= (max_heat/4))
ventnumber = max_heat
weapon_state = STATE_VENTING
playsound(src, 'sound/effects/turbolift/turbolift-close.ogg', 100, 1)
playsound(src, overheat_sound, 100, 1)

/obj/machinery/ship_weapon/energy/ui_act(action, params)

if(..())
Expand All @@ -104,6 +115,8 @@
power_modifier = value
if("activeToggle")
active = !active
if("vent")
vent()
return

/obj/machinery/ship_weapon/energy/attack_hand(mob/user)
Expand Down Expand Up @@ -262,7 +275,7 @@
if(weapon_state == STATE_OVERLOAD)
return
if(weapon_state == STATE_VENTING)
if(heat <= max_heat-V)
if(heat <= max_heat-ventnumber)
weapon_state = STATE_NOTHING
return
heat = max(((H*1.2)-H),0)
Expand Down Expand Up @@ -377,10 +390,4 @@



/obj/machinery/ship_weapon/energy/proc/vent()
if(heat > (max_heat/4) )
weapon_state = STATE_VENTING
var/V = max_heat - 3(max_heat/4)
if(heat <= (max_heat/4) )
var/V = max_heat
weapon_state = STATE_VENTING

6 changes: 6 additions & 0 deletions tgui/packages/tgui/interfaces/EnergyWeapons.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ export const EnergyWeapons = (props, context) => {
average: [0.2, 0.5],
bad: [0.5, Infinity],
}} />
<Button
width="150px"
content="Vent Heat"
icon="exclamation-triangle"
color={"bad"}
onClick={() => act('vent')} />
Charge:
<br />
<ProgressBar
Expand Down

0 comments on commit feb5d39

Please sign in to comment.