Skip to content

Commit

Permalink
Tesla rebalance
Browse files Browse the repository at this point in the history
Dissipate nerfed, only dissipates every 5 process() ticks (but takes off double)
Required growing energy's exponential growth dropped from 50% of current energy to 25% of current energy.
When shooting out shorter ranged zaps from the orbiting balls, it nerfs their power proportionally.
Grounding rods are seen as being 2 tiles closer than they are to increase their likelihood of being chosen.
  • Loading branch information
MrStonedOne committed May 13, 2016
1 parent d41be10 commit c72451d
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions code/modules/power/tesla/energy_ball.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
contained = 0
density = 1
energy = 0
dissipate = 1
dissipate_delay = 5
dissipate_strength = 1
var/list/orbiting_balls = list()
var/produced_power
var/energy_to_raise = 32
Expand All @@ -51,7 +54,7 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
if(!orbiting)
handle_energy()

move_the_basket_ball(4 + orbiting_balls.len * 2)
move_the_basket_ball(4 + orbiting_balls.len * 1.5)

playsound(src.loc, 'sound/magic/lightningbolt.ogg', 100, 1, extrarange = 30)

Expand All @@ -63,7 +66,8 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
pixel_x = -32
pixel_y = -32
for (var/ball in orbiting_balls)
tesla_zap(ball, rand(1, Clamp(orbiting_balls.len, 3, 7)), TESLA_MINI_POWER)
var/range = rand(1, Clamp(orbiting_balls.len, 3, 7))
tesla_zap(ball, range, TESLA_MINI_POWER/7*range)
else
energy = 0 // ensure we dont have miniballs of miniballs

Expand All @@ -88,9 +92,10 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,


/obj/singularity/energy_ball/proc/handle_energy()

if(energy >= energy_to_raise)
energy_to_lower = energy_to_raise - 20
energy_to_raise = energy_to_raise * 1.5
energy_to_raise = energy_to_raise * 1.25

playsound(src.loc, 'sound/magic/lightning_chargeup.ogg', 100, 1, extrarange = 30)
spawn(100)
Expand All @@ -105,16 +110,17 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
orbitsize -= (orbitsize / world.icon_size) * (world.icon_size * 0.25)

EB.orbit(src, orbitsize, pick(FALSE, TRUE), rand(10, 25), pick(3, 4, 5, 6, 36))


else if(energy < energy_to_lower && orbiting_balls.len)
energy_to_raise = energy_to_raise / 1.5
energy_to_lower = (energy_to_raise / 1.5) - 20
energy_to_raise = energy_to_raise / 1.25
energy_to_lower = (energy_to_raise / 1.25) - 20

var/Orchiectomy_target = pick(orbiting_balls)
qdel(Orchiectomy_target)

else if(orbiting_balls.len)
energy -= orbiting_balls.len * 0.5
dissipate() //sing code has a much better system.

/obj/singularity/energy_ball/Bump(atom/A)
dust_mobs(A)
Expand All @@ -126,11 +132,13 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
if (istype(target))
target.orbiting_balls += src
poi_list -= src
target.dissipate_strength = orbiting_balls.len

. = ..()

if (istype(target))
target.orbiting_balls -= src
target.dissipate_strength = orbiting_balls.len
if (!loc)
qdel(src)

Expand Down Expand Up @@ -171,7 +179,7 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
continue //no need checking these other things

else if(istype(A, /obj/machinery/power/grounding_rod))
var/dist = get_dist(source, A)
var/dist = get_dist(source, A)-2
if(dist < closest_dist || !closest_grounding_rod)
closest_grounding_rod = A
closest_atom = A
Expand Down

0 comments on commit c72451d

Please sign in to comment.