mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 14:08:31 +01:00
[READY] Fixes some clown car bugs and adds emag abilities (#39937)
add: Clown cars can now fit any mob (besides megafauna) add: Repair your clown car with bananas add: Emag the clowncar to unlock a button panel. Activate it to press a random button for a random effect! balance: lowers health and cost of clown car fix: removes a return in the clown car code that caused the wrong flags to be assigned fix: you cant open the clowncar trunk from the inside anymore, you can still escape though. fix: fixes broken to_chat in clown car
This commit is contained in:
@@ -1480,7 +1480,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
|
||||
someone saves them or they manage to crawl out. Be sure not to ram into any walls or vending machines, as the springloaded seats \
|
||||
are very sensetive. Now with our included lube defense mechanism which will protect you against any angry shitcurity!"
|
||||
item = /obj/vehicle/sealed/car/clowncar
|
||||
cost = 18
|
||||
cost = 15
|
||||
restricted_roles = list("Clown")
|
||||
|
||||
// Pointless
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
/obj/vehicle/sealed/car/MouseDrop_T(atom/dropping, mob/M)
|
||||
if(!M.canmove || M.stat || M.restrained())
|
||||
return FALSE
|
||||
if(ismob(dropping) && M != dropping)
|
||||
var/mob/D = dropping
|
||||
M.visible_message("<span class='warning'>[M] starts forcing [D] into [src]!</span>")
|
||||
mob_try_forced_enter(M, D)
|
||||
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)
|
||||
@@ -39,10 +39,20 @@
|
||||
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))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name = "clown car"
|
||||
desc = "How someone could even fit in there is beyond me."
|
||||
icon_state = "clowncar"
|
||||
max_integrity = 500
|
||||
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
|
||||
@@ -10,6 +10,9 @@
|
||||
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()
|
||||
. = ..()
|
||||
@@ -20,7 +23,7 @@
|
||||
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
|
||||
return
|
||||
add_control_flags(M, VEHICLE_CONTROL_KIDNAPPED)
|
||||
|
||||
/obj/vehicle/sealed/car/clowncar/mob_forced_enter(mob/M, silent = FALSE)
|
||||
@@ -33,14 +36,25 @@
|
||||
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/Bump(atom/movable/M)
|
||||
..()
|
||||
if(iscarbon(M))
|
||||
var/mob/living/carbon/C = M
|
||||
C.Knockdown(50)
|
||||
C.visible_message("<span class='warning'>[src] rams into [C] and sucks him up!</span>") //fuck off shezza this isn't ERP.
|
||||
mob_forced_enter(C)
|
||||
/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>")
|
||||
@@ -48,6 +62,69 @@
|
||||
playsound(src, 'sound/vehicles/clowncar_crashpins.ogg', 75)
|
||||
DumpMobs(TRUE)
|
||||
|
||||
/obj/vehicle/sealed/car/clowncar/deconstruct(disassembled = 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
|
||||
|
||||
@@ -83,25 +83,26 @@
|
||||
user.put_in_hands(inserted_key)
|
||||
inserted_key = null
|
||||
|
||||
/obj/vehicle/sealed/deconstruct(disassembled = TRUE)
|
||||
. = ..()
|
||||
/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
|
||||
mob_exit(Carbon, null, randomstep)
|
||||
Carbon.Knockdown(40)
|
||||
|
||||
/obj/vehicle/sealed/proc/DumpSpecificMobs(flag, randomstep = TRUE)
|
||||
for(var/i in occupants)
|
||||
if((occupants[i] & flag) && iscarbon(i))
|
||||
var/mob/living/carbon/C = i
|
||||
mob_exit(C, null, randomstep)
|
||||
C.Knockdown(40)
|
||||
|
||||
|
||||
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
|
||||
return FALSE
|
||||
|
||||
@@ -153,3 +153,14 @@
|
||||
/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)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.6 KiB |
Reference in New Issue
Block a user