mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Merge pull request #3865 from CHOMPStation2/upstream-merge-12452
[MIRROR] D-Type REG engine
This commit is contained in:
@@ -126,6 +126,11 @@
|
||||
if(!buckled && shoes) // Shoes can make you go faster.
|
||||
. += shoes.slowdown
|
||||
|
||||
//VOREStation Addition Start
|
||||
if(buckled && istype(buckled, /obj/machinery/power/rtg/d_type_reg))
|
||||
. += shoes.slowdown
|
||||
//VOREStation Addition End
|
||||
|
||||
// Loop through some slots, and add up their slowdowns.
|
||||
// Includes slots which can provide armor, the back slot, and suit storage.
|
||||
for(var/obj/item/I in list(wear_suit, w_uniform, back, gloves, head, s_store))
|
||||
|
||||
@@ -281,3 +281,120 @@
|
||||
if(istype(Proj) && !Proj.nodamage && ((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE)) && Proj.damage >= 20)
|
||||
log_and_message_admins("[ADMIN_LOOKUPFLW(Proj.firer)] triggered a kugelblitz core explosion at [x],[y],[z] via projectile.")
|
||||
asplod()
|
||||
|
||||
/obj/machinery/power/rtg/d_type_reg
|
||||
name = "d-type rotary electric generator"
|
||||
desc = "It looks kind of like a large hamster wheel."
|
||||
icon = 'icons/obj/power_vrx96.dmi'
|
||||
icon_state = "reg"
|
||||
circuit = /obj/item/weapon/circuitboard/machine/reg
|
||||
irradiate = FALSE
|
||||
power_gen = 0 //It's big but it gets adjusted based on what you put into it!!!
|
||||
var/default_power_gen = 1000000
|
||||
var/part_mult = 0
|
||||
pixel_x = -32
|
||||
plane = ABOVE_MOB_PLANE
|
||||
layer = ABOVE_MOB_LAYER
|
||||
buckle_dir = EAST
|
||||
interact_offline = TRUE
|
||||
density = FALSE
|
||||
|
||||
/obj/machinery/power/rtg/d_type_reg/Initialize()
|
||||
. = ..()
|
||||
pixel_x = -32
|
||||
|
||||
/obj/machinery/power/rtg/d_type_reg/Destroy()
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/power/rtg/d_type_reg/user_buckle_mob(mob/living/M, mob/user, var/forced = FALSE, var/silent = TRUE)
|
||||
. = ..()
|
||||
M.pixel_y = 8
|
||||
M.visible_message("<span class='notice'>\The [M], hops up onto \the [src] and begins running!</span>")
|
||||
|
||||
/obj/machinery/power/rtg/d_type_reg/unbuckle_mob(mob/living/buckled_mob, force = FALSE)
|
||||
. = ..()
|
||||
buckled_mob.pixel_y = initial(buckled_mob.pixel_y)
|
||||
|
||||
/obj/machinery/power/rtg/d_type_reg/RefreshParts()
|
||||
var/n = 0
|
||||
for(var/obj/item/weapon/stock_parts/SP in component_parts)
|
||||
n += SP.rating
|
||||
part_mult = n
|
||||
|
||||
/obj/machinery/power/rtg/d_type_reg/attackby(obj/item/I, mob/user, params)
|
||||
if(default_deconstruction_screwdriver(user, I))
|
||||
return
|
||||
else if(default_deconstruction_crowbar(user, I))
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rtg/d_type_reg/update_icon()
|
||||
if(panel_open)
|
||||
icon_state = "reg-o"
|
||||
else if(buckled_mobs && buckled_mobs.len > 0)
|
||||
icon_state = "reg-a"
|
||||
else
|
||||
icon_state = "reg"
|
||||
|
||||
/obj/machinery/power/rtg/d_type_reg/process()
|
||||
..()
|
||||
if(buckled_mobs && buckled_mobs.len > 0)
|
||||
for(var/mob/living/L in buckled_mobs)
|
||||
runner_process(L)
|
||||
else
|
||||
power_gen = 0
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/power/rtg/d_type_reg/proc/runner_process(var/mob/living/runner)
|
||||
if(runner.stat != CONSCIOUS)
|
||||
unbuckle_mob(runner)
|
||||
runner.visible_message("<span class='warning'>\The [runner], topples off of \the [src]!</span>")
|
||||
return
|
||||
var/cool_rotations
|
||||
if(ishuman(runner))
|
||||
var/mob/living/carbon/human/R = runner
|
||||
cool_rotations = R.movement_delay()
|
||||
else if (isanimal(runner))
|
||||
var/mob/living/simple_mob/R = runner
|
||||
cool_rotations = R.movement_delay()
|
||||
log_and_message_admins("I got [cool_rotations] from [runner]")
|
||||
if(cool_rotations <= 0)
|
||||
cool_rotations = 0.5
|
||||
log_and_message_admins("That's less than 1 so let's make it [cool_rotations]")
|
||||
cool_rotations = default_power_gen / cool_rotations
|
||||
log_and_message_admins("I am dividing [default_power_gen] by that much.")
|
||||
switch(runner.nutrition)
|
||||
if(1000 to INFINITY) //VERY WELL FED, ZOOM!!!!
|
||||
cool_rotations *= (runner.nutrition * 0.001)
|
||||
log_and_message_admins("[runner] is over fed so we are producing over 100%")
|
||||
if(500 to 1000) //Well fed!
|
||||
cool_rotations = cool_rotations
|
||||
if(400 to 500)
|
||||
cool_rotations *= 0.9
|
||||
if(300 to 400)
|
||||
cool_rotations *= 0.75
|
||||
if(200 to 300)
|
||||
cool_rotations *= 0.5
|
||||
if(100 to 200)
|
||||
cool_rotations *= 0.25
|
||||
else //TOO HUNGY IT TIME TO STOP!!!
|
||||
unbuckle_mob(runner)
|
||||
runner.visible_message("<span class='notice'>\The [runner], panting and exhausted hops off of \the [src]!</span>")
|
||||
if(part_mult > 1)
|
||||
cool_rotations += (cool_rotations * (part_mult - 1)) / 4
|
||||
log_and_message_admins("The part multiplier is [part_mult].")
|
||||
power_gen = cool_rotations
|
||||
log_and_message_admins("We are outputting [cool_rotations].")
|
||||
runner.nutrition --
|
||||
|
||||
/obj/machinery/power/rtg/d_type_reg/emp_act(severity)
|
||||
return
|
||||
|
||||
/obj/item/weapon/circuitboard/machine/reg
|
||||
name = T_BOARD("REG")
|
||||
build_path = /obj/machinery/power/rtg/d_type_reg
|
||||
board_type = new /datum/frame/frame_types/machine
|
||||
origin_tech = list(TECH_DATA = 2, TECH_POWER = 4, TECH_ENGINEERING = 4)
|
||||
req_components = list(
|
||||
/obj/item/stack/cable_coil = 5,
|
||||
/obj/item/weapon/stock_parts/capacitor = 1)
|
||||
BIN
icons/obj/power_vrx96.dmi
Normal file
BIN
icons/obj/power_vrx96.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Reference in New Issue
Block a user