Merge pull request #15275 from keronshb/halloweenball2021

Spookystation (Ball Map) and Vector Cars
This commit is contained in:
Lin
2021-11-17 16:26:07 +00:00
committed by GitHub
59 changed files with 84970 additions and 3 deletions
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@@ -0,0 +1,311 @@
//Halloween Fluff Papers!
/obj/item/paper/pamphlet/balls/spookyasylum
name = "ASYLUMNAME Pamphlet"
info = "<center><b>The Twin Nexus Hotel</center></b><br><center><i>A place of Sanctuary</i></center><br><br><center>Welcome to The Twin-Nexus Hotel, \[insert name here]! The loyal staff stride to their best effort to cater for the best possible experience for all space(wo)men! If you have any questions or comments, please ask one of our on-board staff for more information.</center>"
/obj/item/paper/fluff/balls/spookyasylum/cell03
name = "Cell 3 Patient Information"
info = "<b>Name:</b> J. Crane<br><b>Age:</b> 46 <b>Gender:</b> M <b>Height:</b> 183cm <b>Weight:</b> 81kg<br><b>Notes:</b> Patient exhibits violent tendencies and is not to be released from restraints under any circumstances. To reduce risk of violent outbreaks, birds; which patient has a strong phobia towards; are no longer allowed in proximity of cells, this includes the chief of staff's pet parrot."
/obj/item/paper/fluff/balls/spookyasylum/cell04
name = "Cell 4 Patient Information"
info = "<b>Name:</b> Fidel S.<br><b>Age:</b> 20 <b>Gender:</b> M <b>Height:</b> 170cm <b>Weight:</b> 68kg<br><b>Notes:</b> Patient appears to be under the delusion that he is a dog, suffers from incontinence, and bites staff. Patient to be kept restrained in cell after attacking orderly Robinson, do not remove patient's muzzle outside designated meal periods."
/obj/item/paper/fluff/balls/spookyasylum/traffickingvictim
name = "Cell 1 Patient Information"
info = "<b>Name:</b> S. Albright<br><b>Age:</b> 26 <b>Gender:</b> F <b>Height:</b> 174cm <b>Weight:</b> 63kg<br><b>Notes:</b> \[The notes are crossed out and unreadable, but there is writing on the back of the paper] Buyer found in Sol system, wealthy Martian man looking for a cheap bride, doesn't mind poor condition of the merchandise. Will be packaging with the next supply ship for transport."
/obj/item/paper/fluff/balls/spookyasylum/healstaffnote
name = "Shipping Manifest 'Healing Staves'"
info = "Contained in this chest are several magical healing staves created by NT sanctioned warlocks, please use them in the event an employee is injured during the festivities. We hope you have a safe and enjoyable celebration, remember you are expected to return to work promptly at its conclusion.<br>We apologize in the unlikely event the contents of the crate are scattered around the asylum by its teleportation."
//Dorm Buttons
/obj/machinery/button/door/dorms/dorm01
name = "dorm 1 button"
id = "D100"
normaldoorcontrol = 1
pixel_x = 24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm02
name = "dorm 2 button"
id = "D101"
normaldoorcontrol = 1
pixel_x = 24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm03
name = "dorm 3 button"
id = "D102"
normaldoorcontrol = 1
pixel_x = 24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm04
name = "dorm 4 button"
id = "D103"
normaldoorcontrol = 1
pixel_x = 24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm05
name = "dorm 5 button"
id = "D104"
normaldoorcontrol = 1
pixel_x = -24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm06
name = "dorm 6 button"
id = "D105"
normaldoorcontrol = 1
pixel_x = -24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm07
name = "dorm 7 button"
id = "D106"
normaldoorcontrol = 1
pixel_x = -24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm08
name = "dorm 8 button"
id = "D107"
normaldoorcontrol = 1
pixel_x = 24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm09
name = "dorm 9 button"
id = "D108"
normaldoorcontrol = 1
pixel_x = 24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm10
name = "dorm 10 button"
id = "D109"
normaldoorcontrol = 1
pixel_x = 24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm11
name = "dorm 11 button"
id = "D110"
normaldoorcontrol = 1
pixel_x = -24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm12
name = "dorm 12 button"
id = "D111"
normaldoorcontrol = 1
pixel_x = -24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm13
name = "dorm 13 button"
id = "D112"
normaldoorcontrol = 1
pixel_x = -24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm14
name = "dorm 14 button"
id = "D113"
normaldoorcontrol = 1
pixel_x = 24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm15
name = "dorm 15 button"
id = "D114"
normaldoorcontrol = 1
pixel_x = 24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm16
name = "dorm 16 button"
id = "D115"
normaldoorcontrol = 1
pixel_x = 24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm17
name = "dorm 17 button"
id = "D116"
normaldoorcontrol = 1
pixel_x = -24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm18
name = "dorm 18 button"
id = "D117"
normaldoorcontrol = 1
pixel_x = -24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm19
name = "dorm 19 button"
id = "D118"
normaldoorcontrol = 1
pixel_x = -24
specialfunctions = 4
/obj/machinery/button/door/dorms/dorm20
name = "dorm 20 button"
id = "D119"
normaldoorcontrol = 1
pixel_x = -24
specialfunctions = 4
/obj/machinery/button/door/dorms/patient1
name = "door bolt"
id = "D120"
normaldoorcontrol = 1
pixel_x = 24
pixel_y = -8
specialfunctions = 4
/obj/machinery/button/door/dorms/patient2
name = "door bolt"
id = "D121"
normaldoorcontrol = 1
pixel_x = 24
pixel_y = -8
specialfunctions = 4
/obj/machinery/button/door/dorms/luxury1
name = "Privacy Shutter Control"
id = "L00"
pixel_x = -8
pixel_y = -24
/obj/machinery/button/door/dorms/luxury2
name = "Privacy Shutter Control"
id = "L01"
pixel_x = 8
pixel_y = -24
/obj/machinery/button/door/dorms/luxury3
name = "Privacy Shutter Control"
id = "L02"
pixel_x = 8
pixel_y = 24
/obj/machinery/button/door/dorms/luxury4
name = "Privacy Shutter Control"
id = "L03"
pixel_x = -24
pixel_y = 8
//Dorm Doors
/obj/machinery/door/airlock/wood/dorms/dorm01
name = "Room 1"
id_tag = "D100"
/obj/machinery/door/airlock/wood/dorms/dorm02
name = "Room 2"
id_tag = "D101"
/obj/machinery/door/airlock/wood/dorms/dorm03
name = "Room 3"
id_tag = "D102"
/obj/machinery/door/airlock/wood/dorms/dorm04
name = "Room 4"
id_tag = "D103"
/obj/machinery/door/airlock/wood/dorms/dorm05
name = "Room 5"
id_tag = "D104"
/obj/machinery/door/airlock/wood/dorms/dorm06
name = "Room 6"
id_tag = "D105"
/obj/machinery/door/airlock/wood/dorms/dorm07
name = "Room 7"
id_tag = "D106"
/obj/machinery/door/airlock/wood/dorms/dorm08
name = "Room 8"
id_tag = "D107"
/obj/machinery/door/airlock/wood/dorms/dorm09
name = "Room 9"
id_tag = "D108"
/obj/machinery/door/airlock/wood/dorms/dorm10
name = "Room 10"
id_tag = "D109"
/obj/machinery/door/airlock/wood/dorms/dorm11
name = "Room 11"
id_tag = "D110"
/obj/machinery/door/airlock/wood/dorms/dorm12
name = "Room 12"
id_tag = "D111"
/obj/machinery/door/airlock/wood/dorms/dorm13
name = "Room 13"
id_tag = "D112"
/obj/machinery/door/airlock/wood/dorms/dorm14
name = "Room 14"
id_tag = "D113"
/obj/machinery/door/airlock/wood/dorms/dorm15
name = "Room 15"
id_tag = "D114"
/obj/machinery/door/airlock/wood/dorms/dorm16
name = "Room 16"
id_tag = "D115"
/obj/machinery/door/airlock/wood/dorms/dorm17
name = "Room 17"
id_tag = "D116"
/obj/machinery/door/airlock/wood/dorms/dorm18
name = "Room 18"
id_tag = "D117"
/obj/machinery/door/airlock/wood/dorms/dorm19
name = "Room 19"
id_tag = "D118"
/obj/machinery/door/airlock/wood/dorms/dorm20
name = "Room 20"
id_tag = "D119"
/obj/machinery/door/airlock/wood/dorms/patient1
name = "Recovery Room 1"
id_tag = "D120"
/obj/machinery/door/airlock/wood/dorms/patient2
name = "Recovery Room 2"
id_tag = "D121"
//Luxury Dorm Shutters
/obj/machinery/door/poddoor/shutters/preopen/luxury_dorms/luxury01
name = "Privacy Shutters"
id = "L00"
/obj/machinery/door/poddoor/shutters/preopen/luxury_dorms/luxury02
name = "Privacy Shutters"
id = "L01"
/obj/machinery/door/poddoor/shutters/preopen/luxury_dorms/luxury03
name = "Privacy Shutters"
id = "L02"
/obj/machinery/door/poddoor/shutters/preopen/luxury_dorms/luxury04
name = "Privacy Shutters"
id = "L03"
Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

@@ -0,0 +1,28 @@
PROCESSING_SUBSYSTEM_DEF(vectorcraft)
name = "Vectorcraft Movement"
priority = 40
wait = 2
stat_tag = "VC"
flags = SS_NO_INIT|SS_TICKER|SS_KEEP_TIMING
//var/flightsuit_processing = FLIGHTSUIT_PROCESSING_FULL
/* unsure if needed
/datum/controller/subsystem/processing/vectorcraft/Initialize()
sync_flightsuit_processing()
/datum/controller/subsystem/processing/vectorcraft/vv_edit_var(var_name, var_value)
..()
switch(var_name)
if("flightsuit_processing")
sync_flightsuit_processing()
/datum/controller/subsystem/processing/vectorcraft/proc/sync_flightsuit_processing()
for(var/obj/vehicle/sealed/vectorcraft/VC in processing)
VC.sync_processing(src)
if(flightsuit_processing == FLIGHTSUIT_PROCESSING_NONE) //Don't even bother firing.
can_fire = FALSE
else
can_fire = TRUE
*/
@@ -0,0 +1,28 @@
/obj/vehicle/sealed/vectorcraft/CMO
name = "CMO's hovercar"
icon_state = "zoomscoot_CMO"
/obj/vehicle/sealed/vectorcraft/RD
name = "RD's hovercar"
icon_state = "zoomscoot_RD"
/obj/vehicle/sealed/vectorcraft/hop
name = "HOP\'s hovercar"
icon_state = "zoomscoot_HOP"
/obj/vehicle/sealed/vectorcraft/hos
name = "HOS\'s hovercar"
icon_state = "zoomscoot_HOS"
/obj/vehicle/sealed/vectorcraft/CE
name = "CE\'s hovercar"
icon_state = "zoomscoot_CE"
/obj/vehicle/sealed/vectorcraft/QM
name = "QM\'s hovercar"
icon_state = "zoomscoot_QM"
/obj/vehicle/sealed/vectorcraft/CAPT
name = "Captain\'s hovercar"
icon_state = "zoomscoot_CAPT"
boost_power = 20 //gosh capt how come CC lets you have more boost power?
@@ -0,0 +1,603 @@
#define SPEED_MOD 5
#define PX_OFFSET 16 //half of total px size of sprite
//Cars that drfit
//By Fermi!
/obj/vehicle/sealed/vectorcraft
name = "all-terrain hovercraft"
desc = "An all-terrain vehicle built for traversing rough terrain with ease. One of the few old-Earth technologies that are still relevant on most planet-bound outposts."
icon_state = "zoomscoot"
movedelay = 5
//allow_diagonal_dir = TRUE - find fix for this later
inertia_moving = FALSE
animate_movement = 0
max_integrity = 100
//key_type = /obj/item/key
var/obj/structure/trunk //Trunkspace of craft
var/vector = list("x" = 0, "y" = 0) //vector math
var/tile_loc = list("x" = 0, "y" = 0) //x y offset of tile
var/max_acceleration = 5.25
var/accel_step = 0.3
var/acceleration = 0.4
var/max_deceleration = 2
var/max_velocity = 110
var/boost_power = 15
var/enginesound_delay = 0
var/gear
var/boost_cooldown
var/mob/living/carbon/human/driver
/obj/vehicle/sealed/vectorcraft/mob_enter(mob/living/M)
if(!driver)
driver = M
if(gear != "auto")
gear = driver.a_intent
start_engine()
to_chat(M, "<span class='big notice'>How to drive:</span> \n<span class='notice'><i>Hold wasd to gain speed in a direction, c to enable/disable the clutch, 1 2 3 4 to change gears while holding a direction (make sure the clutch is enabled when you change gears, you should hear a sound when you've successfully changed gears), r to toggle handbrake, hold alt for brake and press shift for boost (the machine will beep when the boost is recharged)! If you hear an ebbing sound like \"brbrbrbrbr\" you need to gear down, the whining sound means you need to gear up. Hearing a pleasant \"whumwhumwhum\" is optimal gearage! It can be a lil slow to start, so make sure you're in the 1st gear.\n</i></span>")
return ..()
/obj/vehicle/sealed/vectorcraft/mob_exit(mob/living/M)
.=..()
if(!driver)
stop_engine()
return
if(driver.client)
driver.client.pixel_x = 0
driver.client.pixel_y = 0
driver.pixel_x = 0
driver.pixel_y = 0
if(M == driver)
driver = null
gear = initial(gear)
stop_engine()
//////////////////////////////////////////////////////////////
// Main driving checks //
//////////////////////////////////////////////////////////////
/obj/vehicle/sealed/vectorcraft/proc/start_engine()
if(dead_check())
return
START_PROCESSING(SSvectorcraft, src)
check_gears()
if(!driver)
stop_engine()
/obj/vehicle/sealed/vectorcraft/proc/stop_engine()
STOP_PROCESSING(SSvectorcraft, src)
vector = list("x" = 0, "y" = 0)
acceleration = initial(acceleration)
/obj/vehicle/sealed/vectorcraft/proc/dead_check()
if(driver.stat > 0)
mob_exit(driver)
stop_engine()
return TRUE
return FALSE
//Move the damn car
/obj/vehicle/sealed/vectorcraft/vehicle_move(cached_direction)
if(!driver)
stop_engine()
if(driver.stat == DEAD)
mob_exit(driver)
dir = cached_direction
check_gears()
check_boost()
calc_acceleration()
calc_vector(cached_direction)
/*
var/direction = calc_angle()
if(!direction)
direction = cached_direction
return
*/
/* depreciated
//movespeed
if(lastmove + movedelay > world.time)
return FALSE
lastmove = world.time
if(trailer)
var/dir_to_move = get_dir(trailer.loc, loc)
var/did_move = step(src, direction)
if(did_move)
step(trailer, dir_to_move)
return did_move
else
after_move(direction)
return step(src, direction)
*/
//Passive hover drift
/obj/vehicle/sealed/vectorcraft/proc/hover_loop()
check_boost()
if(driver.m_intent == MOVE_INTENT_WALK)
var/deceleration = max_deceleration
if(driver.in_throw_mode)
deceleration *= 1.5
friction(deceleration, TRUE)
else if(driver.in_throw_mode)
friction(max_deceleration*1.2, TRUE)
friction(max_deceleration/4)
if(trailer)
var/dir_to_move = get_dir(trailer.loc, loc)
var/did_move = move_car()
if(did_move)
step(trailer, dir_to_move)
trailer.pixel_x = tile_loc["x"]
trailer.pixel_y = tile_loc["y"]
after_move(did_move)
return did_move
else
var/direction = move_car()
after_move(direction)
return direction
//I got over messy process procs
/obj/vehicle/sealed/vectorcraft/process()
hover_loop()
dead_check()
//////////////////////////////////////////////////////////////
// Movement procs //
//////////////////////////////////////////////////////////////
/obj/vehicle/sealed/vectorcraft/proc/move_car()
if(GLOB.Debug2)
message_admins("Pre_ Tile_loc: [tile_loc["x"]], [tile_loc["y"]] Vector: [vector["x"]],[vector["y"]]")
var/cached_tile = tile_loc
tile_loc["x"] += vector["x"]/SPEED_MOD
tile_loc["y"] += vector["y"]/SPEED_MOD
//range = -16 to 16
var/x_move = 0
if(tile_loc["x"] > PX_OFFSET)
x_move = round((tile_loc["x"]+PX_OFFSET) / (PX_OFFSET*2), 1)
tile_loc["x"] = ((tile_loc["x"]+PX_OFFSET) % (PX_OFFSET*2))-PX_OFFSET
else if(tile_loc["x"] < -PX_OFFSET)
x_move = round((tile_loc["x"]-PX_OFFSET) / (PX_OFFSET*2), 1)
tile_loc["x"] = ((tile_loc["x"]-PX_OFFSET) % -(PX_OFFSET*2))+PX_OFFSET
var/y_move = 0
if(tile_loc["y"] > PX_OFFSET)
y_move = round((tile_loc["y"]+PX_OFFSET) / (PX_OFFSET*2), 1)
tile_loc["y"] = ((tile_loc["y"]+PX_OFFSET) % (PX_OFFSET*2))-PX_OFFSET
else if(tile_loc["y"] < -PX_OFFSET)
y_move = round((tile_loc["y"]-PX_OFFSET) / (PX_OFFSET*2), 1)
tile_loc["y"] = ((tile_loc["y"]-PX_OFFSET) % -(PX_OFFSET*2))+PX_OFFSET
if(!(x_move == 0 && y_move == 0))
var/turf/T = get_offset_target_turf(src, x_move, y_move)
for(var/atom/A in T.contents)
Bump(A)
if(A.density)
ricochet()
tile_loc = cached_tile
return FALSE
if(T.density)
ricochet()
tile_loc = cached_tile
return FALSE
x += x_move
y += y_move
pixel_x = round(tile_loc["x"], 1)
pixel_y = round(tile_loc["y"], 1)
if(driver && driver.client)
driver.client.pixel_x = pixel_x
driver.client.pixel_y = pixel_y
if(GLOB.Debug2)
message_admins("Post TileLoc:[tile_loc["x"]], [tile_loc["y"]] Movement: [x_move],[y_move]")
message_admins("Pix:[pixel_x],[pixel_y] TileLoc:[tile_loc["x"]], [tile_loc["y"]]. [round(tile_loc["x"])], [round(tile_loc["y"])]")
//no tile movement
if(x_move == 0 && y_move == 0)
return FALSE
//var/direction = calc_step_angle(x_move, y_move)
//if(direction) //If the movement is greater than 2
// step(src, direction)
// after_move(direction)
return TRUE
//////////////////////////////////////////////////////////////
// Check procs //
//////////////////////////////////////////////////////////////
//check the cooldown on the boost
/obj/vehicle/sealed/vectorcraft/proc/check_boost()
if(enginesound_delay < world.time)
enginesound_delay = 0
if(!boost_cooldown)
return
if(boost_cooldown < world.time)
boost_cooldown = 0
playsound(src.loc,'sound/vehicles/boost_ready.ogg', 65, 0)
return
//Make sure the clutch is on while changing gears!!
/obj/vehicle/sealed/vectorcraft/proc/check_gears()
if(!driver)
for(var/i in contents)
if(iscarbon(i))
var/mob/living/carbon/C = i
driver = C
to_chat(driver, "<span class='notice'><b>You shuffle across to the driver's seat of the [src]</b></span>")
start_engine()
break
if(!driver)
stop_engine()
return
if(!gear)
gear = driver.a_intent
if(gear == "auto")
return
//USE THE CCLUUUTCHHH
if(gear != driver.a_intent && SEND_SIGNAL(driver, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_INACTIVE))
//playsound
to_chat(driver, "<span class='warning'><b>The gearbox gives out a horrific sound!</b></span>")
playsound(src.loc,'sound/vehicles/clutch_fail.ogg', 70, 0)
apply_damage(5)
acceleration = acceleration/2
else if(gear != driver.a_intent && SEND_SIGNAL(driver, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_ACTIVE))
playsound(src.loc,'sound/vehicles/clutch_win.ogg', 100, 0)
gear = driver.a_intent
//Bounce the car off a wall
/obj/vehicle/sealed/vectorcraft/proc/bounce()
vector["x"] = -vector["x"]/2
vector["y"] = -vector["y"]/2
acceleration /= 2
/obj/vehicle/sealed/vectorcraft/proc/ricochet(x_move, y_move)
var/speed = calc_speed()
apply_damage(speed/10)
bounce()
//////////////////////////////////////////////////////////////
// Damage procs //
//////////////////////////////////////////////////////////////
//Repairing
/obj/vehicle/sealed/vectorcraft/attackby(obj/item/O, mob/user, params)
.=..()
if(istype(O, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
if(obj_integrity < max_integrity)
if(!O.tool_start_check(user, amount=0))
return
user.visible_message("[user] begins repairing [src].", \
"<span class='notice'>You begin repairing [src]...</span>", \
"<span class='italics'>You hear welding.</span>")
if(O.use_tool(src, user, 40, volume=50))
to_chat(user, "<span class='notice'>You repair [src].</span>")
apply_damage(-max_integrity)
else
to_chat(user, "<span class='notice'>[src] does not need repairs.</span>")
/obj/vehicle/sealed/vectorcraft/attack_hand(mob/user)
remove_key(driver)
..()
//Heals/damages the car
/obj/vehicle/sealed/vectorcraft/proc/apply_damage(damage)
obj_integrity -= damage
var/healthratio = ((obj_integrity/max_integrity)/4) + 0.75
max_acceleration = initial(max_acceleration) * healthratio
max_deceleration = initial(max_deceleration) * healthratio
boost_power = initial(boost_power) * healthratio
if(obj_integrity <= 0)
mob_exit(driver)
var/datum/effect_system/reagents_explosion/e = new()
var/turf/T = get_turf(src)
e.set_up(1, T, 1, 3)
e.start()
visible_message("The [src] explodes from taking too much damage!")
qdel(src)
if(obj_integrity > max_integrity)
obj_integrity = max_integrity
//
/obj/vehicle/sealed/vectorcraft/Bump(atom/M)
var/speed = calc_speed()
if(isliving(M))
var/mob/living/C = M
if(!C.anchored)
var/atom/throw_target = get_edge_target_turf(C, calc_angle())
C.throw_at(throw_target, 10, 14)
to_chat(C, "<span class='warning'><b>You are hit by the [src]!</b></span>")
to_chat(driver, "<span class='warning'><b>You just ran into [C] you crazy lunatic!</b></span>")
C.adjustBruteLoss(speed/10)
return ..()
//playsound
if(istype(M, /obj/vehicle/sealed/vectorcraft))
var/obj/vehicle/sealed/vectorcraft/Vc = M
Vc.apply_damage(speed/5)
Vc.vector["x"] += vector["x"]/2
Vc.vector["y"] += vector["y"]/2
apply_damage(speed/10)
bounce()
return ..()
if(istype(M, /obj/))
var/obj/O = M
if(O.density)
O.take_damage(speed*2.5)
return ..()
//////////////////////////////////////////////////////////////
// Calc procs //
//////////////////////////////////////////////////////////////
/*Calc_step_angle calculates angle based off pixel x,y movement (x,y in)
Calc angle calcus angle based off vectors
calc_speed() returns the highest var of x or y relative
calc accel calculates the acceleration to be added to vector
calc vector updates the internal vector
friction reduces the vector by an ammount to both axis*/
//How fast the car is going atm
/obj/vehicle/sealed/vectorcraft/proc/calc_velocity() //Depreciated.
var/speed = calc_speed()
switch(speed)
if(-INFINITY to 10)
movedelay = 5
inertia_move_delay = 5
if(10 to 20)
movedelay = 4
inertia_move_delay = 4
if(20 to 35)
movedelay = 3
inertia_move_delay = 3
if(35 to 60)
movedelay = 2
inertia_move_delay = 2
if(60 to 90)
movedelay = 1
inertia_move_delay = 1
if(90 to INFINITY)
movedelay = 0
inertia_move_delay = 0
return
/*
if(driver.sprinting && !(boost_cooldown))
acceleration += boost_power //You got boost power!
boost_cooldown = world.time + 150
playsound(src.loc,'sound/vehicles/boost.ogg', 50, 0)
//playsound
*/
/obj/vehicle/sealed/vectorcraft/proc/calc_step_angle(x, y)
if((sqrt(x**2))>1 || (sqrt(y**2))>1) //Too large a movement for a step
return FALSE
if(x == 1)
if (y == 1)
return NORTHEAST
else if (y == -1)
return SOUTHEAST
else if (y == 0)
return EAST
else
message_admins("something went wrong; y = [y]")
else if (x == -1)
if (y == 1)
return NORTHWEST
else if (y == -1)
return SOUTHWEST
else if (y == 0)
return WEST
else
message_admins("something went wrong; y = [y]")
else if (x != 0)
message_admins("something went wrong; x = [x]")
if (y == 1)
return NORTH
else if (y == -1)
return SOUTH
else if (x != 0)
message_admins("something went wrong; y = [y]")
return FALSE
//Returns the angle to move towards
/obj/vehicle/sealed/vectorcraft/proc/calc_angle()
var/x = round(vector["x"], 1)
var/y = round(vector["y"], 1)
if(y == 0)
if(x > 0)
return EAST
else if(x < 0)
return WEST
if(x == 0)
if(y > 0)
return NORTH
else if(y < 0)
return SOUTH
if(x == 0 || y == 0)
return FALSE
var/angle = (ATAN2(x,y))
//if(angle < 0)
// angle += 360
//message_admins("x:[x], y: [y], angle:[angle]")
//I WISH I HAD RADIANSSSSSSSSSS
if(angle > 0)
switch(angle)
if(0 to 22)
return EAST
if(22 to 67)
return NORTHEAST
if(67 to 112)
return NORTH
if(112 to 157)
return NORTHWEST
if(157 to 180)
return WEST
else
switch(angle)
if(0 to -22)
return EAST
if(-22 to -67)
return SOUTHEAST
if(-67 to -112)
return SOUTH
if(-112 to -157)
return SOUTHWEST
if(-157 to -180)
return WEST
//updates the internal speed of the car (used for crashing)
/obj/vehicle/sealed/vectorcraft/proc/calc_speed()
var/speed = max(sqrt((vector["x"]**2)), sqrt((vector["y"]**2)))
return speed
//Converts "gear" from intent to numerics
/obj/vehicle/sealed/vectorcraft/proc/convert_gear()
switch(gear)
if("help")
return 1
if("disarm")
return 2
if("grab")
return 3
if("harm")
return 4
//Calculates the acceleration
/obj/vehicle/sealed/vectorcraft/proc/calc_acceleration() //Make speed 0 - 100 regardless of gear here
if(SEND_SIGNAL(driver, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_ACTIVE))//clutch is on
return FALSE
if(gear == "auto")
acceleration += accel_step
acceleration = clamp(acceleration, initial(acceleration), max_acceleration)
if(!enginesound_delay)
playsound(src.loc,'sound/vehicles/norm_eng.ogg', 25, 0)
enginesound_delay = world.time + 16
return
var/gear_val = convert_gear()
var/min_accel = max_acceleration*( (((gear_val-1) * 20) + ((gear_val-1)*5)) /100)
var/max_accel = max_acceleration*((gear_val * 25)/100) //1.25 - 5
if(acceleration < min_accel)
acceleration += accel_step/10
if(!enginesound_delay)
playsound(src.loc,'sound/vehicles/low_eng.ogg', 25, 0)
enginesound_delay = world.time + 16
else if (acceleration > max_accel)
acceleration -= accel_step
if(!enginesound_delay)
playsound(src.loc,'sound/vehicles/high_eng.ogg', 25, 0)
enginesound_delay = world.time + 16
else
if(gear_val == 1)
acceleration += accel_step*3.5
else
acceleration += accel_step
if(!enginesound_delay)
playsound(src.loc,'sound/vehicles/norm_eng.ogg', 25, 0)
enginesound_delay = world.time + 16
if(acceleration > ((max_acceleration*calc_speed())/90) && acceleration > max_acceleration/5)
acceleration -= accel_step*2
if(!enginesound_delay)
playsound(src.loc,'sound/vehicles/high_eng.ogg', 25, 0)
enginesound_delay = world.time + 16
return
acceleration = clamp(acceleration, initial(acceleration), max_acceleration)
//calulate the vector change
/obj/vehicle/sealed/vectorcraft/proc/calc_vector(direction)
if(SEND_SIGNAL(driver, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_ACTIVE))//clutch is on
return FALSE
var/cached_acceleration = acceleration
var/boost_active = FALSE
if((driver.combat_flags & COMBAT_FLAG_SPRINT_ACTIVE) && !(boost_cooldown))
cached_acceleration += boost_power //You got boost power!
boost_cooldown = world.time + 80
playsound(src.loc,'sound/vehicles/boost.ogg', 100, 0)
boost_active = TRUE
//playsound
var/result_vector = vector
switch(direction)
if(NORTH)
result_vector["y"] += cached_acceleration
if(NORTHEAST)
result_vector["x"] += cached_acceleration/1.4
result_vector["y"] += cached_acceleration/1.4
if(EAST)
result_vector["x"] += cached_acceleration
if(SOUTHEAST)
result_vector["x"] += cached_acceleration/1.4
result_vector["y"] -= cached_acceleration/1.4
if(SOUTH)
result_vector["y"] -= cached_acceleration
if(SOUTHWEST)
result_vector["x"] -= cached_acceleration/1.4
result_vector["y"] -= cached_acceleration/1.4
if(WEST)
result_vector["x"] -= cached_acceleration
if(NORTHWEST)
result_vector["y"] += cached_acceleration/1.4
result_vector["x"] -= cached_acceleration/1.4
if(boost_active)
vector["x"] = result_vector["x"]
vector["y"] = result_vector["y"]
else
vector["x"] = clamp(result_vector["x"], -max_velocity, max_velocity)
vector["y"] = clamp(result_vector["y"], -max_velocity, max_velocity)
if(vector["x"] > max_velocity || vector["x"] < -max_velocity)
vector["x"] = vector["x"] - (vector["x"]/10)
vector["x"] = clamp(vector["x"], -250, 250)
if(vector["y"] > max_velocity || vector["y"] < -max_velocity)
vector["y"] = vector["y"] - (vector["y"]/10)
vector["y"] = clamp(vector["y"], -250, 250)
return
//Reduces speed
/obj/vehicle/sealed/vectorcraft/proc/friction(change, sfx = FALSE)
//decell X
if(vector["x"] == 0 && vector["y"] == 0)
return
if(vector["x"] <= -change)
vector["x"] += change
else if(vector["x"] >= change)
vector["x"] -= change
else
vector["x"] = 0
//decell Y
if(vector["y"] <= -change)
vector["y"] += change
else if(vector["y"] >= change)
vector["y"] -= change
else
vector["y"] = 0
if(sfx)
playsound(src.loc,'sound/vehicles/skid.ogg', 50, 0)
@@ -0,0 +1,57 @@
/obj/vehicle/sealed/vectorcraft/cyber
name = "Cyberscuttle"
desc = "A robust hovercar that, until recently, could self drive. Unfortunately it was found that the AI was terrified of orbs and drove away from them at all costs. Overall a smashing hovercar."
max_acceleration = 4.5
accel_step = 0.4
acceleration = 0.5
max_deceleration = 3.5
max_velocity = 95
max_integrity = 150
icon_state = "cyber"
/obj/vehicle/sealed/vectorcraft/clown
name = "Clowncraft"
icon_state = "clowncar"
max_acceleration = 4.7
accel_step = 0.4
acceleration = 0.5
max_deceleration = 4
max_velocity = 90
boost_power = 25
max_integrity = 80
/obj/vehicle/sealed/vectorcraft/truck
name = "Hovertruck"
desc = "An all-terrain vehicle built for traversing rough terrain with ease."
gear = "auto"
icon_state = "truck"
max_acceleration = 4.25
accel_step = 0.4
acceleration = 0.5
max_deceleration = 5
max_velocity = 90
boost_power = 10
max_integrity = 200
/obj/vehicle/sealed/vectorcraft/ambulance
name = "Ambulance"
icon_state = "ambutruck"
max_acceleration = 4.25
accel_step = 0.4
acceleration = 0.5
max_deceleration = 5
max_velocity = 90
boost_power = 40
max_integrity = 200
/obj/vehicle/sealed/vectorcraft/auto
name = "Automatic hovercraft"
gear = "auto"
icon_state = "zoomscoot_auto"
max_acceleration = 4
accel_step = 0.22
acceleration = 0.30
max_deceleration = 2
max_velocity = 90
boost_power = 5
max_integrity = 100