module things, jfc

This commit is contained in:
Poojawa
2018-09-11 07:51:01 -05:00
parent 8b9ef1e400
commit 284e9d0325
695 changed files with 11343 additions and 5661 deletions
+8 -7
View File
@@ -1,6 +1,3 @@
#define VEHICLE_CONTROL_PERMISSION 1
#define VEHICLE_CONTROL_DRIVE 2
/obj/vehicle
name = "generic vehicle"
desc = "Yell at coderbus."
@@ -72,8 +69,8 @@
return FALSE
occupants[M] = NONE
add_control_flags(M, control_flags)
grant_passenger_actions(M)
after_add_occupant(M)
grant_passenger_actions(M)
return TRUE
/obj/vehicle/proc/after_add_occupant(mob/M)
@@ -119,8 +116,12 @@
step(trailer, dir_to_move)
return did_move
else
after_move(direction)
return step(src, direction)
/obj/vehicle/proc/after_move(direction)
return
/obj/vehicle/proc/add_control_flags(mob/controller, flags)
if(!istype(controller) || !flags)
return FALSE
@@ -139,12 +140,12 @@
remove_controller_actions_by_flag(controller, i)
return TRUE
/obj/vehicle/Collide(atom/movable/M)
/obj/vehicle/Bump(atom/movable/M)
. = ..()
if(emulate_door_bumps)
if(istype(M, /obj/machinery/door) && has_buckled_mobs())
if(istype(M, /obj/machinery/door))
for(var/m in occupants)
M.CollidedWith(m)
M.Bumped(m)
/obj/vehicle/Move(newloc, dir)
. = ..()
+78
View File
@@ -0,0 +1,78 @@
/obj/vehicle/sealed/car
layer = ABOVE_MOB_LAYER
anchored = TRUE
var/car_traits = NONE //Bitflag for special behavior such as kidnapping
var/engine_sound = 'sound/vehicles/carrev.ogg'
var/last_enginesound_time
var/engine_sound_length = 20 //Set this to the length of the engine sound
var/escape_time = 200 //Time it takes to break out of the car
/obj/vehicle/sealed/car/generate_actions()
. = ..()
initialize_controller_action_type(/datum/action/vehicle/sealed/remove_key, VEHICLE_CONTROL_DRIVE)
if(car_traits & CAN_KIDNAP)
initialize_controller_action_type(/datum/action/vehicle/sealed/DumpKidnappedMobs, VEHICLE_CONTROL_DRIVE)
/obj/vehicle/sealed/car/MouseDrop_T(atom/dropping, mob/M)
if(!M.canmove || M.stat || M.restrained())
return FALSE
if(isliving(dropping) && M != dropping)
var/mob/living/L = dropping
L.visible_message("<span class='warning'>[M] starts forcing [L] into [src]!</span>")
mob_try_forced_enter(M, L)
return ..()
/obj/vehicle/sealed/car/mob_try_exit(mob/M, mob/user, silent = FALSE)
if(M == user && (occupants[M] & VEHICLE_CONTROL_KIDNAPPED))
to_chat(user, "<span class='notice'>You push against the back of [src] trunk to try and get out.</span>")
if(!do_after(user, escape_time, target = src))
return FALSE
to_chat(user,"<span class='danger'>[user] gets out of [src]</span>")
mob_exit(M, silent)
return TRUE
mob_exit(M, silent)
return TRUE
/obj/vehicle/sealed/car/after_move(direction)
if(world.time < last_enginesound_time + engine_sound_length)
return
last_enginesound_time = world.time
playsound(src, engine_sound, 100, TRUE)
/obj/vehicle/sealed/car/attacked_by(obj/item/I, mob/living/user)
if(!I.force)
return
if(occupants[user])
to_chat(user, "<span class='notice'>Your attack bounces off of the car's padded interior.</span>")
return
return ..()
/obj/vehicle/sealed/car/attack_hand(mob/living/user)
. = ..()
if(!(car_traits & CAN_KIDNAP))
return
if(occupants[user])
return
to_chat(user, "<span class='notice'>You start opening [src]'s trunk.</span>")
if(do_after(user, 30))
if(return_amount_of_controllers_with_flag(VEHICLE_CONTROL_KIDNAPPED))
to_chat(user, "<span class='notice'>The people stuck in [src]'s trunk all come tumbling out.</span>")
DumpSpecificMobs(VEHICLE_CONTROL_KIDNAPPED)
else
to_chat(user, "<span class='notice'>It seems [src]'s trunk was empty.</span>")
/obj/vehicle/sealed/car/proc/mob_try_forced_enter(mob/forcer, mob/M, silent = FALSE)
if(!istype(M))
return FALSE
if(occupant_amount() >= max_occupants)
return FALSE
if(do_mob(forcer, get_enter_delay(M), target = src))
mob_forced_enter(M, silent)
return TRUE
return FALSE
/obj/vehicle/sealed/car/proc/mob_forced_enter(mob/M, silent = FALSE)
if(!silent)
M.visible_message("<span class='warning'>[M] is forced into \the [src]!</span>")
M.forceMove(src)
add_occupant(M, VEHICLE_CONTROL_KIDNAPPED)
+130
View File
@@ -0,0 +1,130 @@
/obj/vehicle/sealed/car/clowncar
name = "clown car"
desc = "How someone could even fit in there is beyond me."
icon_state = "clowncar"
max_integrity = 150
armor = list("melee" = 70, "bullet" = 40, "laser" = 40, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 80)
enter_delay = 20
max_occupants = 50
movedelay = 0.6
car_traits = CAN_KIDNAP
key_type = /obj/item/bikehorn
key_type_exact = FALSE
var/droppingoil = FALSE
var/RTDcooldown = 150
var/lastRTDtime = 0
/obj/vehicle/sealed/car/clowncar/generate_actions()
. = ..()
initialize_controller_action_type(/datum/action/vehicle/sealed/horn/clowncar, VEHICLE_CONTROL_DRIVE)
/obj/vehicle/sealed/car/clowncar/auto_assign_occupant_flags(mob/M)
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.mind && H.mind.assigned_role == "Clown") //Ensures only clowns can drive the car. (Including more at once)
add_control_flags(M, VEHICLE_CONTROL_DRIVE|VEHICLE_CONTROL_PERMISSION)
return
add_control_flags(M, VEHICLE_CONTROL_KIDNAPPED)
/obj/vehicle/sealed/car/clowncar/mob_forced_enter(mob/M, silent = FALSE)
. = ..()
playsound(src, pick('sound/vehicles/clowncar_load1.ogg', 'sound/vehicles/clowncar_load2.ogg'), 75)
/obj/vehicle/sealed/car/clowncar/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
. = ..()
if(prob(33))
visible_message("<span class='danger'>[src] spews out a ton of space lube!</span>")
new /obj/effect/particle_effect/foam(loc) //YEET
/obj/vehicle/sealed/car/clowncar/attacked_by(obj/item/I, mob/living/user)
. = ..()
if(istype(I, /obj/item/reagent_containers/food/snacks/grown/banana))
var/obj/item/reagent_containers/food/snacks/grown/banana/banana = I
obj_integrity += min(banana.seed.potency, max_integrity-obj_integrity)
to_chat(user, "<span class='danger'>You use the [banana] to repair the [src]!</span>")
qdel(banana)
/obj/vehicle/sealed/car/clowncar/Bump(atom/movable/M)
. = ..()
if(isliving(M))
if(ismegafauna(M))
return
var/mob/living/L = M
if(iscarbon(L))
var/mob/living/carbon/C = L
C.Knockdown(40) //I play to make sprites go horizontal
L.visible_message("<span class='warning'>[src] rams into [L] and sucks him up!</span>") //fuck off shezza this isn't ERP.
mob_forced_enter(L)
playsound(src, pick('sound/vehicles/clowncar_ram1.ogg', 'sound/vehicles/clowncar_ram2.ogg', 'sound/vehicles/clowncar_ram3.ogg'), 75)
else if(istype(M, /turf/closed))
visible_message("<span class='warning'>[src] rams into [M] and crashes!</span>")
playsound(src, pick('sound/vehicles/clowncar_crash1.ogg', 'sound/vehicles/clowncar_crash2.ogg'), 75)
playsound(src, 'sound/vehicles/clowncar_crashpins.ogg', 75)
DumpMobs(TRUE)
/obj/vehicle/sealed/car/clowncar/emag_act(mob/user)
if(obj_flags & EMAGGED)
return
obj_flags |= EMAGGED
to_chat(user, "<span class='danger'>You scramble the clowncar child safety lock and a panel with 6 colorful buttons appears!</span>")
initialize_controller_action_type(/datum/action/vehicle/sealed/RollTheDice, VEHICLE_CONTROL_DRIVE)
/obj/vehicle/sealed/car/clowncar/Destroy()
playsound(src, 'sound/vehicles/clowncar_fart.ogg', 100)
return ..()
/obj/vehicle/sealed/car/clowncar/after_move(direction)
. = ..()
if(droppingoil)
new /obj/effect/decal/cleanable/oil/slippery(loc)
/obj/vehicle/sealed/car/clowncar/proc/RollTheDice(mob/user)
if(world.time - lastRTDtime < RTDcooldown)
to_chat(user, "<span class='notice'>The button panel is currently recharging.</span>")
return
lastRTDtime = world.time
var/randomnum = rand(1,6)
switch(randomnum)
if(1)
visible_message("<span class='danger'>[user] has pressed one of the colorful buttons on [src] and a special banana peel drops out of it.</span>")
new /obj/item/grown/bananapeel/specialpeel(loc)
if(2)
visible_message("<span class='danger'>[user] has pressed one of the colorful buttons on [src] and unknown chemicals flood out of it.</span>")
var/datum/reagents/R = new/datum/reagents(300)
R.my_atom = src
R.add_reagent(get_random_reagent_id(), 100)
var/datum/effect_system/foam_spread/foam = new
foam.set_up(200, loc, R)
foam.start()
if(3)
visible_message("<span class='danger'>[user] has pressed one of the colorful buttons on [src] and the clown car turns on its singularity disguise system.</span>")
icon = 'icons/obj/singularity.dmi'
icon_state = "singularity_s1"
addtimer(CALLBACK(src, .proc/ResetIcon), 100)
if(4)
visible_message("<span class='danger'>[user] has pressed one of the colorful buttons on [src] and the clown car spews out a cloud of laughing gas.</span>")
var/datum/reagents/R = new/datum/reagents(300)
R.my_atom = src
R.add_reagent("superlaughter", 50)
var/datum/effect_system/smoke_spread/chem/smoke = new()
smoke.set_up(R, 4)
smoke.attach(src)
smoke.start()
if(5)
visible_message("<span class='danger'>[user] has pressed one of the colorful buttons on [src] and the clown car starts dropping an oil trail.</span>")
droppingoil = TRUE
addtimer(CALLBACK(src, .proc/StopDroppingOil), 30)
if(6)
visible_message("<span class='danger'>[user] has pressed one of the colorful buttons on [src] and the clown car lets out a comedic toot.</span>")
playsound(src, 'sound/vehicles/clowncar_fart.ogg', 100)
for(var/mob/living/L in orange(loc, 6))
L.emote("laughs")
for(var/mob/living/L in occupants)
L.emote("laughs")
/obj/vehicle/sealed/car/clowncar/proc/ResetIcon()
icon = initial(icon)
icon_state = initial(icon_state)
/obj/vehicle/sealed/car/clowncar/proc/StopDroppingOil()
droppingoil = FALSE
+57 -5
View File
@@ -35,22 +35,74 @@
if(!istype(M))
return FALSE
if(!silent)
M.visible_message("<span class='boldnotice'>[M] climbs into \the [src]!</span>")
M.visible_message("<span class='notice'>[M] climbs into \the [src]!</span>")
M.forceMove(src)
add_occupant(M)
return TRUE
/obj/vehicle/sealed/proc/mob_try_exit(mob/M, mob/user, silent = FALSE)
mob_exit(M, silent)
/obj/vehicle/sealed/proc/mob_try_exit(mob/M, mob/user, silent = FALSE, randomstep = FALSE)
mob_exit(M, silent, randomstep)
/obj/vehicle/sealed/proc/mob_exit(mob/M, silent = FALSE)
/obj/vehicle/sealed/proc/mob_exit(mob/M, silent = FALSE, randomstep = FALSE)
if(!istype(M))
return FALSE
remove_occupant(M)
M.forceMove(exit_location(M))
if(randomstep)
var/turf/target_turf = get_step(exit_location(M), pick(GLOB.cardinals))
M.throw_at(target_turf, 5, 10)
if(!silent)
M.visible_message("<span class='boldnotice'>[M] drops out of \the [src]!</span>")
M.visible_message("<span class='notice'>[M] drops out of \the [src]!</span>")
return TRUE
/obj/vehicle/sealed/proc/exit_location(M)
return drop_location()
/obj/vehicle/sealed/attackby(obj/item/I, mob/user, params)
if(key_type && !is_key(inserted_key) && is_key(I))
if(user.transferItemToLoc(I, src))
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
if(inserted_key) //just in case there's an invalid key
inserted_key.forceMove(drop_location())
inserted_key = I
else
to_chat(user, "<span class='notice'>[I] seems to be stuck to your hand!</span>")
return
return ..()
/obj/vehicle/sealed/proc/remove_key(mob/user)
if(!inserted_key)
to_chat(user, "<span class='notice'>There is no key in [src]!</span>")
return
if(!is_occupant(user) || !(occupants[user] & VEHICLE_CONTROL_DRIVE))
to_chat(user, "<span class='notice'>You must be driving [src] to remove [src]'s key!</span>")
return
to_chat(user, "<span class='notice'>You remove [inserted_key] from [src].</span>")
inserted_key.forceMove(drop_location())
user.put_in_hands(inserted_key)
inserted_key = null
/obj/vehicle/sealed/Destroy()
DumpMobs()
explosion(loc, 0, 1, 2, 3, 0)
return ..()
/obj/vehicle/sealed/proc/DumpMobs(randomstep = TRUE)
for(var/i in occupants)
mob_exit(i, null, randomstep)
if(iscarbon(i))
var/mob/living/carbon/Carbon = i
Carbon.Knockdown(40)
/obj/vehicle/sealed/proc/DumpSpecificMobs(flag, randomstep = TRUE)
for(var/i in occupants)
if((occupants[i] & flag))
mob_exit(i, null, randomstep)
if(iscarbon(i))
var/mob/living/carbon/C = i
C.Knockdown(40)
/obj/vehicle/sealed/AllowDrop()
return FALSE
+4 -1
View File
@@ -14,7 +14,10 @@
/obj/vehicle/ridden/examine(mob/user)
. = ..()
if(key_type)
to_chat(user, "<span class='notice'>Put a key inside it by clicking it with the key. If there's a key inside, you can remove it via Alt-Click!</span>")
if(!inserted_key)
to_chat(user, "<span class='notice'>Put a key inside it by clicking it with the key.</span>")
else
to_chat(user, "<span class='notice'>Alt-click [src] to remove the key.</span>")
/obj/vehicle/ridden/generate_action_type(actiontype)
var/datum/action/vehicle/ridden/A = ..()
+19 -5
View File
@@ -26,7 +26,7 @@
. = ..()
for(var/m in buckled_mobs)
var/mob/living/buckled_mob = m
if(buckled_mob.get_num_legs() > 0)
if(buckled_mob.get_num_legs(FALSE) > 0)
buckled_mob.pixel_y = 5
else
buckled_mob.pixel_y = -4
@@ -41,14 +41,15 @@
/obj/vehicle/ridden/scooter/skateboard
name = "skateboard"
desc = "An unfinished scooter which can only barely be called a skateboard. It's still rideable, but probably unsafe. Looks like you'll need to add a few rods to make handlebars."
desc = "An unfinished scooter which can only barely be called a skateboard. It's still rideable, but probably unsafe. Looks like you'll need to add a few rods to make handlebars. Alt-click to adjust speed."
icon_state = "skateboard"
density = FALSE
var/adjusted_speed = FALSE
/obj/vehicle/ridden/scooter/skateboard/Initialize()
. = ..()
var/datum/component/riding/D = LoadComponent(/datum/component/riding)
D.vehicle_move_delay = 0
D.vehicle_move_delay = 1
D.set_vehicle_dir_layer(SOUTH, ABOVE_MOB_LAYER)
D.set_vehicle_dir_layer(NORTH, OBJ_LAYER)
D.set_vehicle_dir_layer(EAST, OBJ_LAYER)
@@ -63,7 +64,7 @@
density = FALSE
return ..()
/obj/vehicle/ridden/scooter/skateboard/Collide(atom/A)
/obj/vehicle/ridden/scooter/skateboard/Bump(atom/A)
. = ..()
if(A.density && has_buckled_mobs())
var/mob/living/H = buckled_mobs[1]
@@ -92,6 +93,17 @@
M.put_in_hands(board)
qdel(src)
/obj/vehicle/ridden/scooter/skateboard/AltClick(mob/user)
var/datum/component/riding/R = src.GetComponent(/datum/component/riding)
if (!adjusted_speed)
R.vehicle_move_delay = 0
to_chat(user, "<span class='notice'>You adjust the wheels on [src] to make it go faster.</span>")
adjusted_speed = TRUE
else
R.vehicle_move_delay = 1
to_chat(user, "<span class='notice'>You adjust the wheels on [src] to make it go slower.</span>")
adjusted_speed = FALSE
//CONSTRUCTION
/obj/item/scooter_frame
name = "scooter frame"
@@ -136,6 +148,8 @@
return ..()
/obj/vehicle/ridden/scooter/skateboard/screwdriver_act(mob/living/user, obj/item/I)
if(..())
return TRUE
to_chat(user, "<span class='notice'>You begin to deconstruct and remove the wheels on [src]...</span>")
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You deconstruct the wheels on [src].</span>")
@@ -176,7 +190,7 @@
to_chat(M, "<span class='notice'>You pop out the Wheely-Heel's wheels.</span>")
return ..()
/obj/vehicle/ridden/scooter/wheelys/Collide(atom/A)
/obj/vehicle/ridden/scooter/wheelys/Bump(atom/A)
. = ..()
if(A.density && has_buckled_mobs())
var/mob/living/H = buckled_mobs[1]
+7 -3
View File
@@ -47,7 +47,7 @@
var/static/mutable_appearance/overlay = mutable_appearance(icon, "speedwagon_cover", ABOVE_MOB_LAYER)
max_buckled_mobs = 4
var/crash_all = FALSE //CHAOS
pixel_y = -48 //to fix the offset when Initialized()
pixel_y = -48
pixel_x = -48
/obj/vehicle/ridden/space/speedwagon/Initialize()
@@ -59,10 +59,14 @@
D.set_riding_offsets(2, list(TEXT_NORTH = list(19, -5, 4), TEXT_SOUTH = list(-13, 3, 4), TEXT_EAST = list(-4, -3, 4.1), TEXT_WEST = list(4, 28, 3.9)))
D.set_riding_offsets(3, list(TEXT_NORTH = list(-10, -18, 4.2), TEXT_SOUTH = list(16, 25, 3.9), TEXT_EAST = list(-22, 30), TEXT_WEST = list(22, -3, 4.1)))
D.set_riding_offsets(4, list(TEXT_NORTH = list(19, -18, 4.2), TEXT_SOUTH = list(-13, 25, 3.9), TEXT_EAST = list(-22, 3, 3.9), TEXT_WEST = list(22, 28)))
D.set_vehicle_dir_offsets(NORTH, -48, -48)
D.set_vehicle_dir_offsets(SOUTH, -48, -48)
D.set_vehicle_dir_offsets(EAST, -48, -48)
D.set_vehicle_dir_offsets(WEST, -48, -48)
for(var/i in GLOB.cardinals)
D.set_vehicle_dir_layer(i, BELOW_MOB_LAYER)
/obj/vehicle/ridden/space/speedwagon/Collide(atom/movable/A)
/obj/vehicle/ridden/space/speedwagon/Bump(atom/movable/A)
. = ..()
if(A.density && has_buckled_mobs())
var/atom/throw_target = get_edge_target_turf(A, dir)
@@ -85,4 +89,4 @@
if(has_buckled_mobs())
for(var/atom/A in range(2, src))
if(!(A in buckled_mobs))
Collide(A)
Bump(A)
+54
View File
@@ -103,6 +103,7 @@
/datum/action/vehicle/sealed/climb_out
name = "Climb Out"
desc = "Climb out of your vehicle!"
button_icon_state = "car_eject"
/datum/action/vehicle/sealed/climb_out/Trigger()
if(..() && istype(vehicle_entered_target))
@@ -110,3 +111,56 @@
/datum/action/vehicle/ridden
var/obj/vehicle/ridden/vehicle_ridden_target
/datum/action/vehicle/sealed/remove_key
name = "Remove key"
desc = "Take your key out of the vehicle's ignition"
button_icon_state = "car_removekey"
/datum/action/vehicle/sealed/remove_key/Trigger()
vehicle_entered_target.remove_key(owner)
//CLOWN CAR ACTION DATUMS
/datum/action/vehicle/sealed/horn
name = "Honk Horn"
desc = "Honk your classy horn."
button_icon_state = "car_horn"
var/hornsound = 'sound/items/carhorn.ogg'
var/last_honk_time
/datum/action/vehicle/sealed/horn/Trigger()
if(world.time - last_honk_time > 20)
vehicle_entered_target.visible_message("<span class='danger'>[vehicle_entered_target] loudly honks</span>")
to_chat(owner, "<span class='notice'>You press the vehicle's horn.</span>")
playsound(vehicle_entered_target, hornsound, 75)
last_honk_time = world.time
/datum/action/vehicle/sealed/horn/clowncar/Trigger()
if(world.time - last_honk_time > 20)
vehicle_entered_target.visible_message("<span class='danger'>[vehicle_entered_target] loudly honks</span>")
to_chat(owner, "<span class='notice'>You press the vehicle's horn.</span>")
last_honk_time = world.time
if(vehicle_target.inserted_key)
vehicle_target.inserted_key.attack_self(owner) //The key plays a sound
else
playsound(vehicle_entered_target, hornsound, 75)
/datum/action/vehicle/sealed/DumpKidnappedMobs
name = "Dump kidnapped mobs"
desc = "Dump all objects and people in your car on the floor."
button_icon_state = "car_dump"
/datum/action/vehicle/sealed/DumpKidnappedMobs/Trigger()
vehicle_entered_target.visible_message("<span class='danger'>[vehicle_entered_target] starts dumping the people inside of it.</span>")
vehicle_entered_target.DumpSpecificMobs(VEHICLE_CONTROL_KIDNAPPED)
/datum/action/vehicle/sealed/RollTheDice
name = "Press a colorful button"
desc = "Press one of those colorful buttons on your display panel!"
button_icon_state = "car_rtd"
/datum/action/vehicle/sealed/RollTheDice/Trigger()
if(istype(vehicle_entered_target, /obj/vehicle/sealed/car/clowncar))
var/obj/vehicle/sealed/car/clowncar/C = vehicle_entered_target
C.RollTheDice(owner)