diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index 1e890c4151..cf4f368936 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -287,6 +287,20 @@ cost = 1 category = "Mobility" +/datum/spellbook_entry/item/firebird + name = "Chariot" + desc = "A majestic, flaming chariot that can move in space. \ + Warning: You cannot use your teleportation scroll with the chariot. \ + It is recommended that you summon it once you have left your lair." + item_path = /obj/vehicle/firebird + log_name = "FB" + category = "Mobility" + +/datum/spellbook_entry/item/firebird/Buy(mob/living/carbon/human/user,obj/item/weapon/spellbook/book) + . = ..() + if(.) + new /obj/item/key/firebird(get_turf(user)) //key is needed to drive the firebird + /datum/spellbook_entry/item/staffhealing name = "Staff of Healing" desc = "An altruistic staff that can heal the lame and raise the dead." diff --git a/code/modules/vehicles/firebird.dm b/code/modules/vehicles/firebird.dm new file mode 100644 index 0000000000..dd1876f6e2 --- /dev/null +++ b/code/modules/vehicles/firebird.dm @@ -0,0 +1,161 @@ +/obj/item/key/firebird + name = "\improper Firebird key" + desc = "A keyring with a small steel key, and a fancy blue and gold fob." + icon_state = "magic_keys" + + +/obj/vehicle/firebird + name = "Firebird" + desc = "A Pontiac Firebird Trans Am with skulls and crossbones on the hood, dark blue paint, and gold trim. No magic required for this baby." + icon = 'icons/obj/vehicles.dmi' + icon_state = "wizmobile" + keytype = /obj/item/key/firebird + vehicle_move_delay = 1.5 + layer = LYING_MOB_LAYER + spacemove = TRUE + var/playingrunningsound = FALSE //for engine loop + var/boostactive = FALSE + var/datum/action/innate/firebird_boost/F + +/datum/action/innate/firebird_boost + name = "Speed Boost" + check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_STUNNED + button_icon_state = "firebird_boost" + background_icon_state = "bg_spell" + var/boosting = FALSE //whether boost is active + var/recharging = FALSE //whether cooldown is active + +/datum/action/innate/firebird_boost/Activate() + var/obj/vehicle/firebird/buckled_obj + buckled_obj = owner.buckled + if(!recharging) + boosting = TRUE + recharging = TRUE + UpdateButtonIcon() + buckled_obj.boostactive = TRUE + buckled_obj.vehicle_move_delay = 0 + addtimer(src, "deactivate_boost", 30) + addtimer(src, "reset_cooldown", 200) + playsound(buckled_obj, 'sound/items/fultext_launch.wav', 50, 1) + else + owner << "It's still recharging." + +/datum/action/innate/firebird_boost/proc/deactivate_boost() + boosting = FALSE + UpdateButtonIcon() + var/obj/vehicle/firebird/buckled_obj + buckled_obj = owner.buckled + buckled_obj.boostactive = FALSE + buckled_obj.vehicle_move_delay = 1.5 + +/datum/action/innate/firebird_boost/proc/reset_cooldown() + recharging = FALSE + UpdateButtonIcon() + +/datum/action/innate/firebird_boost/IsAvailable() + if(recharging) + return 0 + if(check_flags & AB_CHECK_STUNNED) + if(owner.stunned || owner.weakened) + return 0 + if(check_flags & AB_CHECK_CONSCIOUS) + if(owner.stat) + return 0 + return 1 + +/obj/vehicle/firebird/user_buckle_mob(mob/living/M, mob/user) + ..() + F = new + F.Grant(M) + +/obj/vehicle/firebird/unbuckle_mob(mob/living/buckled_mob,force = 0) + ..() + if(F) + F.Remove(buckled_mob) + +/obj/effect/overlay/temp/firebird_trail + name = "exhaust fumes" + icon_state = "smoke" + layer = BELOW_MOB_LAYER + duration = 10 + randomdir = 0 + +/obj/effect/overlay/temp/firebird_trail/New(loc,move_dir) + ..() + setDir(move_dir) + +/obj/effect/overlay/temp/firebird_firetrail + icon_state = "nothing" + layer = BELOW_MOB_LAYER + duration = 5 + randomdir = 0 + +/obj/effect/overlay/temp/firebird_firetrail/New(loc,move_dir) + ..() + setDir(move_dir) + new /obj/effect/hotspot(get_turf(src)) + +/obj/effect/overlay/temp/firebird_firetrail/Destroy() + ..() + for(var/obj/effect/hotspot/H in loc) + qdel(H) + return ..() + +/obj/vehicle/firebird/Move(newloc,move_dir) + var/turf/oldLoc = loc + . = ..() + if(has_buckled_mobs() && oldLoc != loc) + if(!boostactive) + PoolOrNew(/obj/effect/overlay/temp/firebird_trail,list(oldLoc,move_dir)) + if(boostactive) + PoolOrNew(/obj/effect/overlay/temp/firebird_firetrail,list(oldLoc,move_dir)) + +/obj/vehicle/firebird/handle_vehicle_offsets() + if(has_buckled_mobs()) + for(var/m in buckled_mobs) + var/mob/living/buckled_mob = m + buckled_mob.setDir(dir) + switch(dir) + if(NORTH) + buckled_mob.pixel_x = 0 + buckled_mob.pixel_y = 6 + if(SOUTH) + buckled_mob.pixel_x = 0 + buckled_mob.pixel_y = 2 + if(EAST) + buckled_mob.pixel_x = -2 + buckled_mob.pixel_y = 3 + if(WEST) + buckled_mob.pixel_x = 2 + buckled_mob.pixel_y = 3 + + +/obj/vehicle/firebird/proc/start_engine_sound() //starts the loop + if(vehiclerunning == TRUE && !playingrunningsound) //playingrunningsound is so we don't get more than one loop going + playingrunningsound = TRUE + playsound(src, 'sound/machines/enginestart.ogg', 50, 0) + addtimer(src, "play_engine_sound", 27.6, FALSE) + return TRUE + else + return FALSE + +/obj/vehicle/firebird/proc/play_engine_sound() // loop + if(vehiclerunning == TRUE && playingrunningsound) //will only continue the loop if there's an occupant with the key and the start_engine_sound() was run + playsound(src, 'sound/machines/engine.ogg', 50, 0) + addtimer(src, "play_engine_sound", 18.8, FALSE) + return TRUE + else + playingrunningsound = FALSE + return FALSE + +/obj/vehicle/firebird/relaymove(mob/user, direction) + ..() + start_engine_sound() + +/obj/vehicle/firebird/Bump(atom/movable/M) + ..() + if(has_buckled_mobs()) + if(istype(M, /obj/structure/table)) + M.Destroy() + else if(istype(M, /obj/structure/rack)) + M.Destroy() diff --git a/code/modules/vehicles/speedbike.dm b/code/modules/vehicles/speedbike.dm index f2f4dabdd9..a61b92bff2 100644 --- a/code/modules/vehicles/speedbike.dm +++ b/code/modules/vehicles/speedbike.dm @@ -5,6 +5,7 @@ layer = LYING_MOB_LAYER keytype = null vehicle_move_delay = 0 + spacemove = TRUE var/overlay_state = "cover_blue" var/image/overlay = null @@ -60,4 +61,4 @@ /obj/vehicle/space/speedbike/red icon_state = "speedbike_red" - overlay_state = "cover_red" \ No newline at end of file + overlay_state = "cover_red" diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index 064a6bb147..d905a08fa1 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -13,6 +13,8 @@ var/vehicle_move_delay = 2 //tick delay between movements, lower = faster, higher = slower var/auto_door_open = TRUE var/view_range = 7 + var/vehiclerunning = FALSE //whether the vehicle is running / able to move + var/spacemove = FALSE //Pixels var/generic_pixel_x = 0 //All dirs show this pixel_x for the driver @@ -71,6 +73,7 @@ if(istype(buckled_mob)) buckled_mob.pixel_x = 0 buckled_mob.pixel_y = 0 + vehiclerunning = FALSE if(buckled_mob.client) buckled_mob.client.view = world.view . = ..() @@ -96,8 +99,13 @@ unbuckle_mob(user) if(keycheck(user)) - if(!Process_Spacemove(direction) || world.time < next_vehicle_move || !isturf(loc)) + vehiclerunning = TRUE + if(world.time < next_vehicle_move || !isturf(loc)) return + if(spacemove = FALSE) + if(!Process_Spacemove(direction)) + return + next_vehicle_move = world.time + vehicle_move_delay step(src, direction) diff --git a/icons/mob/actions.dmi b/icons/mob/actions.dmi index d41fc22090..ccf26d2338 100644 Binary files a/icons/mob/actions.dmi and b/icons/mob/actions.dmi differ diff --git a/icons/obj/vehicles.dmi b/icons/obj/vehicles.dmi index 5dd427941e..79e428aca5 100644 Binary files a/icons/obj/vehicles.dmi and b/icons/obj/vehicles.dmi differ diff --git a/sound/machines/engine.ogg b/sound/machines/engine.ogg new file mode 100644 index 0000000000..b9be934bd8 Binary files /dev/null and b/sound/machines/engine.ogg differ diff --git a/sound/machines/enginestart.ogg b/sound/machines/enginestart.ogg new file mode 100644 index 0000000000..14ced3b26e Binary files /dev/null and b/sound/machines/enginestart.ogg differ diff --git a/tgstation.dme b/tgstation.dme index d6799401b0..c4b5825951 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1850,6 +1850,7 @@ #include "code\modules\uplink\uplink.dm" #include "code\modules\uplink\uplink_item.dm" #include "code\modules\vehicles\atv.dm" +#include "code\modules\vehicles\firebird.dm" #include "code\modules\vehicles\pimpin_ride.dm" #include "code\modules\vehicles\scooter.dm" #include "code\modules\vehicles\secway.dm"