Merge branch 'master' into upstream-merge-8298

This commit is contained in:
Novacat
2022-03-22 08:53:45 -04:00
committed by GitHub
218 changed files with 4106 additions and 853 deletions
+111
View File
@@ -281,3 +281,114 @@
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()
if(cool_rotations <= 0)
cool_rotations = 0.5
cool_rotations = default_power_gen / cool_rotations
switch(runner.nutrition)
if(1000 to INFINITY) //VERY WELL FED, ZOOM!!!!
cool_rotations *= (runner.nutrition * 0.001)
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
power_gen = 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)