Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new car for admin-spawn only #59

Merged
merged 10 commits into from
Jan 26, 2024
157 changes: 157 additions & 0 deletions massmeta/code/modules/vehicles/cars/cheburek.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
/// Big 3x3 car only available to admins which can run people over
/obj/vehicle/sealed/car/cheburek
name = "Cheburek"
desc = "The Bucket with bolts and nuts"
icon = 'massmeta/icons/obj/toys/shaha.dmi'
icon_state = "cheburek" // the name form gta 5 you know?
layer = LYING_MOB_LAYER
max_occupants = 4
pixel_y = -48
pixel_x = -48
enter_delay = 0 SECONDS
escape_time = 0 SECONDS // Just get out dumbass
vehicle_move_delay = 0
///Determines whether we throw all things away when ramming them or just mobs, varedit only
var/crash_all = FALSE
/// New gopnik-functions
var/gopmode = FALSE
var/gopgear = 3 // nowadays it has 3(actually 4) five-speed gearbox, someday it had 5... and also R-ocket one
/// headlights of Cheburek, front white-yellow(Done but have some [BUG]'s to resolve!) and rear deep-red(TODO)
light_system = MOVABLE_LIGHT_DIRECTIONAL
light_range = 8
light_power = 2
light_on = FALSE
var/headlight_colors = COLOR_YELLOW
/// turns on and off sound and side lights on repeat
var/isturnsound_on = FALSE

/obj/vehicle/sealed/car/cheburek/Initialize(mapload)
. = ..()

/obj/vehicle/sealed/car/cheburek/process()
if(light_on)
set_light_color(headlight_colors)

/obj/vehicle/sealed/car/cheburek/generate_actions()
. = ..()
initialize_controller_action_type(/datum/action/vehicle/sealed/horn, VEHICLE_CONTROL_DRIVE)
initialize_controller_action_type(/datum/action/vehicle/sealed/gop_headlights, VEHICLE_CONTROL_DRIVE)
initialize_controller_action_type(/datum/action/vehicle/sealed/gopnik, VEHICLE_CONTROL_DRIVE)
initialize_controller_action_type(/datum/action/vehicle/sealed/gop_turn, VEHICLE_CONTROL_DRIVE)
initialize_controller_action_type(/datum/action/vehicle/sealed/gopnik_gear_up, VEHICLE_CONTROL_DRIVE)
initialize_controller_action_type(/datum/action/vehicle/sealed/gopnik_gear_down, VEHICLE_CONTROL_DRIVE)
initialize_passenger_action_type(/datum/action/vehicle/sealed/blyat, VEHICLE_CONTROL_DRIVE)

/obj/vehicle/sealed/car/cheburek/Bump(atom/bumped)
. = ..()
if(!bumped.density || occupant_amount() == 0)
return

if(crash_all)
if(ismovable(bumped))
var/atom/movable/flying_debris = bumped
flying_debris.throw_at(get_edge_target_turf(bumped, dir), 4, 3)
visible_message(span_danger("[src] crashes into [bumped]!"))
playsound(src, 'sound/effects/bang.ogg', 50, TRUE)
if(!ishuman(bumped) || gopgear < 2) // also on low gear you can't bump anyone
return
var/mob/living/carbon/human/rammed = bumped
rammed.Paralyze(100)
rammed.adjustStaminaLoss(30)
rammed.apply_damage(rand(15,30), BRUTE)
if(!crash_all)
rammed.throw_at(get_edge_target_turf(bumped, dir), 4, 3)
visible_message(span_danger("[src] crashes into [rammed]!"))
playsound(src, 'sound/effects/bang.ogg', 50, TRUE)

/obj/vehicle/sealed/car/cheburek/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(occupant_amount() == 0)
return
for(var/atom/future_statistic in range(2, src))
if(future_statistic == src)
continue
if(!LAZYACCESS(occupants, future_statistic))
Bump(future_statistic)


/obj/vehicle/sealed/car/cheburek/proc/toggle_gopmode(mob/user)

if(gopmode) //gopmode activate, deactivate
cut_overlay(image(icon, "car_stickers", ABOVE_MOB_LAYER))
visible_message(span_danger("You removed that odd paint from [src]."))
playsound(src, 'sound/effects/spray.ogg', 30)
gopmode = FALSE
else
add_overlay(image(icon, "car_stickers", ABOVE_MOB_LAYER))
visible_message(span_danger("You put some odd insulating tape on [src]."))
playsound(src, 'sound/effects/spray.ogg', 30)
gopmode = TRUE


/obj/vehicle/sealed/car/cheburek/proc/increase_gop_gear(mob/user)

if(gopgear < 3)
if(rand(1,10) >= 9)
AddElement(/datum/element/waddling)
playsound(src, pick('massmeta/sounds/vehicles/gear_blyat.ogg', 'massmeta/sounds/vehicles/gear_fault.ogg', 'massmeta/sounds/vehicles/gear_nah.ogg', 'massmeta/sounds/vehicles/gear_fault2.ogg', 'massmeta/sounds/vehicles/gear_fault3.ogg'), 50)
addtimer(CALLBACK(src, PROC_REF(revert_waddling)), 1 SECONDS)
else
playsound(src, 'sound/mecha/mechmove04.ogg', 75)

vehicle_move_delay -= 0.5
gopgear += 1
else
visible_message(span_danger("[src] already on maximum gear!"))

/obj/vehicle/sealed/car/cheburek/proc/decrease_gop_gear(mob/user)

if(gopgear > 0)
if(rand(1,10) >= 8) // chance 3 of 10 to hear that funny noise
AddElement(/datum/element/waddling) // your gears are juggling like a clown do
playsound(src, pick('massmeta/sounds/vehicles/gear_blyat.ogg', 'massmeta/sounds/vehicles/gear_fault.ogg', 'massmeta/sounds/vehicles/gear_nah.ogg', 'massmeta/sounds/vehicles/gear_fault2.ogg', 'massmeta/sounds/vehicles/gear_fault3.ogg'), 50)
addtimer(CALLBACK(src, PROC_REF(revert_waddling)), 1 SECONDS)
else
playsound(src, 'sound/mecha/mechmove04.ogg', 75)

vehicle_move_delay += 0.5
gopgear -= 1
else
visible_message(span_danger("[src] already on minumum gear!"))


/obj/vehicle/sealed/car/cheburek/proc/revert_waddling()

visible_message(span_danger("Uhh, gear finnaly shifted on [src]..."))
RemoveElement(/datum/element/waddling)


/obj/vehicle/sealed/car/cheburek/proc/car_lights_toggle(mob/user)

if(!light_on)
cut_overlay(image(icon, "car_headlights", LYING_MOB_LAYER))
else
add_overlay(image(icon, "car_headlights", LYING_MOB_LAYER))


/obj/vehicle/sealed/car/cheburek/proc/toggle_gop_turn(mob/user)

isturnsound_on = !isturnsound_on
// start point of endless tiks
addtimer(CALLBACK(src, PROC_REF(endless_tik)), 0.5 SECONDS)


/obj/vehicle/sealed/car/cheburek/proc/endless_tik()

if(isturnsound_on)
playsound(src, 'massmeta/sounds/vehicles/car_turn_signal.ogg', 60)
cut_overlay(image(icon, "car_blinkers", LYING_MOB_LAYER))
addtimer(CALLBACK(src, PROC_REF(endless_tak)), 0.5 SECONDS)


/obj/vehicle/sealed/car/cheburek/proc/endless_tak()

if(isturnsound_on)
//playsound(src, 'sound/vehicles/car_turn_signal.ogg', 60) // too much noise without delay
add_overlay(image(icon, "car_blinkers", LYING_MOB_LAYER))
addtimer(CALLBACK(src, PROC_REF(endless_tik)), 0.5 SECONDS)
86 changes: 86 additions & 0 deletions massmeta/code/modules/vehicles/vehicle_actions.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@

/datum/action/vehicle/sealed/gopnik
button_icon = 'massmeta/icons/mob/actions/actions_vehicle.dmi'
name = "Toggle Gop Mode"
desc = "Grabs your Vodka and Semki!"
button_icon_state = "gop_mode"
COOLDOWN_DECLARE(gopnik_time_cooldown) //yes, you need some time for repaint your rusty garbage

/datum/action/vehicle/sealed/gopnik/Trigger(trigger_flags)
if(!istype(vehicle_entered_target, /obj/vehicle/sealed/car/cheburek))
return
if(!COOLDOWN_FINISHED(src, gopnik_time_cooldown))
return
COOLDOWN_START(src, gopnik_time_cooldown, 3 SECONDS)
var/obj/vehicle/sealed/car/cheburek/C = vehicle_entered_target
C.toggle_gopmode(owner)

/datum/action/vehicle/sealed/gopnik_gear_up
button_icon = 'massmeta/icons/mob/actions/actions_vehicle.dmi'
name = "Gear UP"
desc = "Make your vedro move faster!"
button_icon_state = "car_gear_up"
COOLDOWN_DECLARE(gopnik_shift_up_cooldown)

/datum/action/vehicle/sealed/gopnik_gear_up/Trigger(trigger_flags)
if(!istype(vehicle_entered_target, /obj/vehicle/sealed/car/cheburek))
return
if(!COOLDOWN_FINISHED(src, gopnik_shift_up_cooldown))
return
COOLDOWN_START(src, gopnik_shift_up_cooldown, 1 SECONDS)
var/obj/vehicle/sealed/car/cheburek/G = vehicle_entered_target
G.increase_gop_gear(owner)

/datum/action/vehicle/sealed/gopnik_gear_down
button_icon = 'massmeta/icons/mob/actions/actions_vehicle.dmi'
name = "Gear DOWN"
desc = "Make your vedro move slower!"
button_icon_state = "car_gear_down"
COOLDOWN_DECLARE(gopnik_shift_down_cooldown)

/datum/action/vehicle/sealed/gopnik_gear_down/Trigger(trigger_flags)
if(!istype(vehicle_entered_target, /obj/vehicle/sealed/car/cheburek))
return
if(!COOLDOWN_FINISHED(src, gopnik_shift_down_cooldown))
return
COOLDOWN_START(src, gopnik_shift_down_cooldown, 1 SECONDS)
var/obj/vehicle/sealed/car/cheburek/G = vehicle_entered_target
G.decrease_gop_gear(owner)

/datum/action/vehicle/sealed/gop_headlights
name = "Toggle Headlights"
desc = "Turn on your brights!"
button_icon_state = "car_headlights"

/datum/action/vehicle/sealed/gop_headlights/Trigger(trigger_flags)
to_chat(owner, span_notice("You flip the switch for the vehicle's headlights."))
vehicle_entered_target.headlights_toggle = !vehicle_entered_target.headlights_toggle
vehicle_entered_target.set_light_on(vehicle_entered_target.headlights_toggle)
vehicle_entered_target.update_appearance()
playsound(owner, vehicle_entered_target.headlights_toggle ? 'sound/weapons/magin.ogg' : 'sound/weapons/magout.ogg', 40, TRUE)
var/obj/vehicle/sealed/car/cheburek/L = vehicle_entered_target
L.car_lights_toggle(owner)

/datum/action/vehicle/sealed/gop_turn
button_icon = 'massmeta/icons/mob/actions/actions_vehicle.dmi'
name = "Avariyka"
desc = "Useful if you need to park your bucket anywhere"
button_icon_state = "car_blinker"

/datum/action/vehicle/sealed/gop_turn/Trigger(trigger_flags)
if(!istype(vehicle_entered_target, /obj/vehicle/sealed/car/cheburek))
return
var/obj/vehicle/sealed/car/cheburek/T = vehicle_entered_target
T.toggle_gop_turn(owner)

/datum/action/vehicle/sealed/blyat
name = "Thank the Clown Car Driver"
desc = "Wait, what clown you meant?"
button_icon_state = "car_thanktheclown"

/datum/action/vehicle/sealed/blyat/Trigger(trigger_flags)
if(!istype(vehicle_entered_target, /obj/vehicle/sealed/car/cheburek))
return

var/obj/vehicle/sealed/car/clowncar/cheburek = vehicle_entered_target
owner.say("Блять!") // yes, without delay
Binary file added massmeta/icons/mob/actions/actions_vehicle.dmi
Binary file not shown.
Binary file added massmeta/icons/obj/toys/shaha.dmi
Binary file not shown.
2 changes: 2 additions & 0 deletions massmeta/includes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
#include "code\modules\projectiles\boxes_magazines\ammo_boxes.dm"
#include "code\modules\projectiles\ammunition\ballistic\rifle.dm"
#include "code\modules\projectiles\projectile\bullets\rifle.dm"
#include "code\modules\vehicles\vehicle_actions.dm"
#include "code\modules\vehicles\cars\cheburek.dm"
#include "code\modules\map_vote.dm"
#include "code\modules\hallucination\fake_chat.dm"
//features
Expand Down
Binary file added massmeta/sounds/vehicles/car_turn_signal.ogg
Binary file not shown.
Binary file added massmeta/sounds/vehicles/gear_blyat.ogg
Binary file not shown.
Binary file added massmeta/sounds/vehicles/gear_fault.ogg
Binary file not shown.
Binary file added massmeta/sounds/vehicles/gear_fault2.ogg
Binary file not shown.
Binary file added massmeta/sounds/vehicles/gear_fault3.ogg
Binary file not shown.
Binary file added massmeta/sounds/vehicles/gear_nah.ogg
Binary file not shown.
Loading