From 08f1269b1fe2951e47b413d02bc3dd6feabe2ed6 Mon Sep 17 00:00:00 2001 From: Qustinnus Date: Wed, 5 Sep 2018 13:18:54 +0200 Subject: [PATCH] [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 --- code/modules/uplink/uplink_items.dm | 2 +- code/modules/vehicles/cars/car.dm | 18 ++++- code/modules/vehicles/cars/clowncar.dm | 99 ++++++++++++++++++++--- code/modules/vehicles/entered.dm | 21 ++--- code/modules/vehicles/vehicle_actions.dm | 11 +++ icons/mob/actions/actions_vehicle.dmi | Bin 1224 -> 1670 bytes 6 files changed, 125 insertions(+), 26 deletions(-) diff --git a/code/modules/uplink/uplink_items.dm b/code/modules/uplink/uplink_items.dm index 54cedf46ab1..f80d1358e17 100644 --- a/code/modules/uplink/uplink_items.dm +++ b/code/modules/uplink/uplink_items.dm @@ -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 diff --git a/code/modules/vehicles/cars/car.dm b/code/modules/vehicles/cars/car.dm index 510242b9dbd..9e9b41bd80c 100644 --- a/code/modules/vehicles/cars/car.dm +++ b/code/modules/vehicles/cars/car.dm @@ -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("[M] starts forcing [D] into [src]!") - mob_try_forced_enter(M, D) + if(isliving(dropping) && M != dropping) + var/mob/living/L = dropping + L.visible_message("[M] starts forcing [L] into [src]!") + 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, "Your attack bounces off of the car's padded interior.") + return + return ..() + /obj/vehicle/sealed/car/attack_hand(mob/living/user) . = ..() if(!(car_traits & CAN_KIDNAP)) return + if(occupants[user]) + return to_chat(user, "You start opening [src]'s trunk.") if(do_after(user, 30)) if(return_amount_of_controllers_with_flag(VEHICLE_CONTROL_KIDNAPPED)) diff --git a/code/modules/vehicles/cars/clowncar.dm b/code/modules/vehicles/cars/clowncar.dm index ceafc64320b..3485c0f378e 100644 --- a/code/modules/vehicles/cars/clowncar.dm +++ b/code/modules/vehicles/cars/clowncar.dm @@ -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("[src] spews out a ton of space lube!") 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("[src] rams into [C] and sucks him up!") //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, "You use the [banana] to repair the [src]!") + 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("[src] rams into [L] and sucks him up!") //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("[src] rams into [M] and crashes!") @@ -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, "You scramble the clowncar child safety lock and a panel with 6 colorful buttons appears!") + 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, "The button panel is currently recharging.") + return + lastRTDtime = world.time + var/randomnum = rand(1,6) + switch(randomnum) + if(1) + visible_message("[user] has pressed one of the colorful buttons on [src] and a special banana peel drops out of it.") + new /obj/item/grown/bananapeel/specialpeel(loc) + if(2) + visible_message("[user] has pressed one of the colorful buttons on [src] and unknown chemicals flood out of it.") + 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("[user] has pressed one of the colorful buttons on [src] and the clown car turns on its singularity disguise system.") + icon = 'icons/obj/singularity.dmi' + icon_state = "singularity_s1" + addtimer(CALLBACK(src, .proc/ResetIcon), 100) + if(4) + visible_message("[user] has pressed one of the colorful buttons on [src] and the clown car spews out a cloud of laughing gas.") + 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("[user] has pressed one of the colorful buttons on [src] and the clown car starts dropping an oil trail.") + droppingoil = TRUE + addtimer(CALLBACK(src, .proc/StopDroppingOil), 30) + if(6) + visible_message("[user] has pressed one of the colorful buttons on [src] and the clown car lets out a comedic toot.") + 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 diff --git a/code/modules/vehicles/entered.dm b/code/modules/vehicles/entered.dm index f25de2d89fc..30ae49ecd28 100644 --- a/code/modules/vehicles/entered.dm +++ b/code/modules/vehicles/entered.dm @@ -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 \ No newline at end of file + return FALSE diff --git a/code/modules/vehicles/vehicle_actions.dm b/code/modules/vehicles/vehicle_actions.dm index 82d64de41d3..8c0e76e06a4 100644 --- a/code/modules/vehicles/vehicle_actions.dm +++ b/code/modules/vehicles/vehicle_actions.dm @@ -153,3 +153,14 @@ /datum/action/vehicle/sealed/DumpKidnappedMobs/Trigger() vehicle_entered_target.visible_message("[vehicle_entered_target] starts dumping the people inside of it.") 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) diff --git a/icons/mob/actions/actions_vehicle.dmi b/icons/mob/actions/actions_vehicle.dmi index c8044ec51f9cadd8afc619ac1ff0a4c559a5b4de..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