mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
A little space pod love (#22555)
* spacepod love * waiting around blows * span * Icon for toggling lights, taxi pod now has actions * forgot to make the lights turn off when the pod is out of juice
This commit is contained in:
@@ -71,3 +71,12 @@
|
||||
..()
|
||||
var/obj/spacepod/S = target
|
||||
S.change_speed()
|
||||
|
||||
/datum/action/spacepod/pilot/toggle_lights
|
||||
name = "Toggle lights"
|
||||
button_icon_state = "toggle_lights"
|
||||
|
||||
/datum/action/spacepod/pilot/toggle_lights/Trigger()
|
||||
..()
|
||||
var/obj/spacepod/S = target
|
||||
S.toggle_lights()
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
/datum/spacepod/equipment
|
||||
var/obj/spacepod/my_atom
|
||||
var/movement_charge = 3
|
||||
var/movement_charge = 2
|
||||
var/weapons_allowed = 1
|
||||
var/obj/item/device/spacepod_equipment/weaponry/weapon_system // weapons system
|
||||
//var/obj/item/device/spacepod_equipment/engine/engine_system // engine system
|
||||
|
||||
@@ -61,6 +61,9 @@
|
||||
/obj/item/pod_parts/pod_frame/attackby(var/obj/O, mob/user)
|
||||
if(istype(O, /obj/item/stack/rods))
|
||||
var/obj/item/stack/rods/R = O
|
||||
if(R.amount < 10)
|
||||
to_chat(user, "<span class='notice'>You need 10 rods to do this!</span>")
|
||||
return
|
||||
var/list/linkedparts = find_square()
|
||||
if(!linkedparts)
|
||||
to_chat(user, "<span class='rose'>You cannot assemble a pod frame because you do not have the necessary assembly.</span>")
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
icon = 'icons/obj/robotics.dmi'
|
||||
icon_state = "fab"
|
||||
build_number = PODFAB
|
||||
build_time = 1
|
||||
nano_file = "podfab.tmpl"
|
||||
research_flags = NANOTOUCH | HASOUTPUT | HASMAT_OVER | TAKESMATIN | ACCESS_EMAG | LOCKBOXES
|
||||
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
#define FIRE 2
|
||||
|
||||
#define SPACEPOD_MOVEDELAY_FAST 0.4
|
||||
#define SPACEPOD_MOVEDELAY_MEDIUM 1
|
||||
#define SPACEPOD_MOVEDELAY_SLOW 3
|
||||
#define SPACEPOD_MOVEDELAY_DEFAULT SPACEPOD_MOVEDELAY_FAST
|
||||
#define SPACEPOD_LIGHTS_CONSUMPTION 2 //battery consumption per second with lights on
|
||||
#define SPACEPOD_LIGHTS_RANGE_ON 8
|
||||
#define SPACEPOD_LIGHTS_RANGE_OFF 3 //one tile beyond the spacepod itself, "cockpit glow"
|
||||
|
||||
#define STATUS_REMOVE 1
|
||||
#define STATUS_ADD 2
|
||||
@@ -30,12 +34,16 @@
|
||||
var/use_internal_tank = 0
|
||||
var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature
|
||||
var/datum/global_iterator/pr_give_air //moves air from tank to cabin
|
||||
var/datum/global_iterator/pr_lights_battery_use //passive battery use for the lights
|
||||
var/hatch_open = 0
|
||||
var/locked = FALSE
|
||||
var/next_firetime = 0
|
||||
var/list/pod_overlays
|
||||
var/health = 400
|
||||
var/maxHealth = 400
|
||||
var/lights_enabled = FALSE
|
||||
light_power = 2
|
||||
light_range = SPACEPOD_LIGHTS_RANGE_OFF
|
||||
appearance_flags = LONG_GLIDE
|
||||
|
||||
var/datum/delay_controller/move_delayer = new(0.1, ARBITRARILY_LARGE_NUMBER) //See setup.dm, 12
|
||||
@@ -45,6 +53,7 @@
|
||||
/datum/action/spacepod/pilot/toggle_passengers,
|
||||
/datum/action/spacepod/pilot/toggle_passenger_weaponry,
|
||||
/datum/action/spacepod/pilot/change_speed,
|
||||
/datum/action/spacepod/pilot/toggle_lights,
|
||||
)
|
||||
var/list/actions_types_pilot = list(/datum/action/spacepod/fire_weapons) //Actions to create when a pilot boards, deleted upon leaving
|
||||
var/list/actions_types_passenger = list(/datum/action/spacepod/fire_weapons) //Actions to create when a passenger boards, deleted upon leaving
|
||||
@@ -71,6 +80,7 @@
|
||||
src.use_internal_tank = 1
|
||||
pr_int_temp_processor = new /datum/global_iterator/pod_preserve_temp(list(src))
|
||||
pr_give_air = new /datum/global_iterator/pod_tank_give_air(list(src))
|
||||
pr_lights_battery_use = new /datum/global_iterator/pod_lights_use_charge(list(src))
|
||||
ES = new(src)
|
||||
for(var/path in actions_types)
|
||||
var/datum/action/A = new path(src)
|
||||
@@ -90,6 +100,8 @@
|
||||
pr_int_temp_processor = null
|
||||
qdel(pr_give_air)
|
||||
pr_give_air = null
|
||||
qdel(pr_lights_battery_use)
|
||||
pr_lights_battery_use = null
|
||||
qdel(ES)
|
||||
ES = null
|
||||
qdel(battery)
|
||||
@@ -487,6 +499,26 @@
|
||||
return stop()
|
||||
return
|
||||
|
||||
/datum/global_iterator/pod_lights_use_charge
|
||||
delay = 10
|
||||
|
||||
process(var/obj/spacepod/spacepod)
|
||||
if(spacepod.battery && spacepod.lights_enabled)
|
||||
if(spacepod.battery.charge > 0)
|
||||
spacepod.battery.use(SPACEPOD_LIGHTS_CONSUMPTION)
|
||||
else
|
||||
spacepod.toggle_lights()
|
||||
return
|
||||
|
||||
/obj/spacepod/proc/toggle_lights()
|
||||
if(lights_enabled)
|
||||
set_light(SPACEPOD_LIGHTS_RANGE_OFF)
|
||||
to_chat(usr, "<span class='notice'>Lights disabled.</span>")
|
||||
else
|
||||
set_light(SPACEPOD_LIGHTS_RANGE_ON)
|
||||
to_chat(usr, "<span class='notice'>Lights enabled.</span>")
|
||||
lights_enabled = !lights_enabled
|
||||
|
||||
/obj/spacepod/Move(NewLoc, Dir = 0, step_x = 0, step_y = 0, glide_size_override = 0)
|
||||
var/oldloc = loc
|
||||
. = ..()
|
||||
@@ -677,9 +709,12 @@
|
||||
if(movement_delay == SPACEPOD_MOVEDELAY_FAST)
|
||||
movement_delay = SPACEPOD_MOVEDELAY_SLOW
|
||||
to_chat(usr, "<span class='notice'>Thrusters strength: low.</span>")
|
||||
else
|
||||
else if(movement_delay == SPACEPOD_MOVEDELAY_MEDIUM)
|
||||
movement_delay = SPACEPOD_MOVEDELAY_FAST
|
||||
to_chat(usr, "<span class='notice'>Thrusters strength: high.</span>")
|
||||
else
|
||||
movement_delay = SPACEPOD_MOVEDELAY_MEDIUM
|
||||
to_chat(usr, "<span class='notice'>Thrusters strength: medium.</span>")
|
||||
|
||||
/obj/spacepod/proc/toggle_passenger_guns()
|
||||
if(usr!=get_pilot())
|
||||
@@ -693,7 +728,11 @@
|
||||
icon_state = "pod_taxi"
|
||||
desc = "Brightly coloured to attract attention of potential passengers. Has room for multiple passengers at the expense of weapons"
|
||||
passenger_limit = 3
|
||||
actions_types = list(/datum/action/spacepod/pilot/toggle_passengers)
|
||||
actions_types = list( //Actions to create and hold for the pilot
|
||||
/datum/action/spacepod/pilot/toggle_passengers,
|
||||
/datum/action/spacepod/pilot/change_speed,
|
||||
/datum/action/spacepod/pilot/toggle_lights,
|
||||
)
|
||||
actions_types_pilot = list()
|
||||
actions_types_passenger = list()
|
||||
|
||||
@@ -705,8 +744,12 @@
|
||||
#undef FIRE
|
||||
|
||||
#undef SPACEPOD_MOVEDELAY_FAST
|
||||
#undef SPACEPOD_MOVEDELAY_MEDIUM
|
||||
#undef SPACEPOD_MOVEDELAY_SLOW
|
||||
#undef SPACEPOD_MOVEDELAY_DEFAULT
|
||||
#undef SPACEPOD_LIGHTS_CONSUMPTION
|
||||
#undef SPACEPOD_LIGHTS_RANGE_ON
|
||||
#undef SPACEPOD_LIGHTS_RANGE_OFF
|
||||
|
||||
#undef STATUS_REMOVE
|
||||
#undef STATUS_ADD
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.3 KiB |
Reference in New Issue
Block a user