diff --git a/code/__DEFINES/vehicles.dm b/code/__DEFINES/vehicles.dm index 3a2e5fc26ec..dd2f2bc5e69 100644 --- a/code/__DEFINES/vehicles.dm +++ b/code/__DEFINES/vehicles.dm @@ -34,3 +34,9 @@ #define CLOWN_CANNON_INACTIVE 0 #define CLOWN_CANNON_BUSY 1 #define CLOWN_CANNON_READY 2 + +//Vim defines +///cooldown between uses of the sound maker +#define VIM_SOUND_COOLDOWN 1 SECONDS +///how much vim heals per weld +#define VIM_HEAL_AMOUNT 20 diff --git a/code/modules/clothing/spacesuits/miscellaneous.dm b/code/modules/clothing/spacesuits/miscellaneous.dm index ebce9405cf9..db8f302d8aa 100644 --- a/code/modules/clothing/spacesuits/miscellaneous.dm +++ b/code/modules/clothing/spacesuits/miscellaneous.dm @@ -282,6 +282,24 @@ Contains: flash_protect = FLASH_PROTECTION_NONE armor = list(MELEE = 0, BULLET = 0, LASER = 0,ENERGY = 0, BOMB = 0, BIO = 100, RAD = 20, FIRE = 50, ACID = 65) +/obj/item/clothing/head/helmet/space/eva/examine(mob/user) + . = ..() + . += span_notice("You can start constructing a critter sized mecha with a [span_bold("cyborg leg")].") + +/obj/item/clothing/head/helmet/space/eva/attackby(obj/item/attacked_with, mob/user, params) + . = ..() + if(.) + return + if(!istype(attacked_with, /obj/item/bodypart/l_leg/robot) && !istype(attacked_with, /obj/item/bodypart/r_leg/robot)) + return + if(ismob(loc)) + user.balloon_alert(user, "drop the helmet first!") + return + user.balloon_alert(user, "leg attached") + new /obj/item/bot_assembly/vim(loc) + qdel(attacked_with) + qdel(src) + /obj/item/clothing/head/helmet/space/freedom name = "eagle helmet" desc = "An advanced, space-proof helmet. It appears to be modeled after an old-world eagle." diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm index 0fe8471d44f..5d31eded154 100644 --- a/code/modules/mob/living/simple_animal/bot/construction.dm +++ b/code/modules/mob/living/simple_animal/bot/construction.dm @@ -526,3 +526,55 @@ new /obj/item/assembly/prox_sensor(Tsec) to_chat(user, span_notice("You detach the proximity sensor from [src].")) build_step-- + +//Vim Assembly +/obj/item/bot_assembly/vim + name = "incomplete vim assembly" + desc = "A space helmet with a leg attached to it. Looks like it needs another leg, if it is to become something." + icon_state = "vim_0" + created_name = "\improper Vim" + +/obj/item/bot_assembly/vim/attackby(obj/item/part, mob/user, params) + . = ..() + if(.) + return + switch(build_step) + if(ASSEMBLY_FIRST_STEP) + if(istype(part, /obj/item/bodypart/l_leg/robot) || istype(part, /obj/item/bodypart/r_leg/robot)) + if(!user.temporarilyRemoveItemFromInventory(part)) + return + balloon_alert(user, "leg attached") + icon_state = "vim_1" + desc = "Some kind of incomplete mechanism. It seems to be missing the headlights." + qdel(part) + build_step++ + + if(ASSEMBLY_SECOND_STEP) + if(istype(part, /obj/item/flashlight)) + if(!user.temporarilyRemoveItemFromInventory(part)) + return + balloon_alert(user, "flashlight added") + icon_state = "vim_2" + desc = "Some kind of incomplete mechanism. The flashlight is added, but not secured." + qdel(part) + build_step++ + + if(ASSEMBLY_THIRD_STEP) + if(part.tool_behaviour == TOOL_SCREWDRIVER) + balloon_alert(user, "securing flashlight...") + if(!part.use_tool(src, user, 4 SECONDS, volume=100)) + return + balloon_alert(user, "flashlight secured") + icon_state = "vim_3" + desc = "Some kind of incomplete mechanism. It seems nearly completed, and just needs a voice assembly." + build_step++ + + if(ASSEMBLY_FOURTH_STEP) + if(istype(part, /obj/item/assembly/voice)) + if(!can_finish_build(part, user)) + return + balloon_alert(user, "assembly finished") + var/obj/vehicle/sealed/car/vim/new_vim = new(drop_location()) + new_vim.name = created_name + qdel(part) + qdel(src) diff --git a/code/modules/vehicles/cars/vim.dm b/code/modules/vehicles/cars/vim.dm new file mode 100644 index 00000000000..481854e8463 --- /dev/null +++ b/code/modules/vehicles/cars/vim.dm @@ -0,0 +1,92 @@ +/** + * ## VIM!!!!!!! + * + * It's a teenie minature mecha... for critters! + * For the critters that cannot be understood, there is a sound creator in the mecha. It also has headlights. + */ +/obj/vehicle/sealed/car/vim + name = "\improper Vim" + desc = "An minature exosuit from Nanotrasen, developed to let the irreplacable station pets live a little longer." + icon_state = "vim" + max_integrity = 50 + armor = list(MELEE = 70, BULLET = 40, LASER = 40, ENERGY = 0, BOMB = 30, BIO = 0, RAD = 0, FIRE = 80, ACID = 80) + enter_delay = 20 + movedelay = 0.6 + engine_sound_length = 0.3 SECONDS + light_system = MOVABLE_LIGHT_DIRECTIONAL + light_range = 4 + light_power = 2 + light_on = FALSE + engine_sound = 'sound/effects/servostep.ogg' + ///TRUE while the vim is being welded + var/being_repaired = FALSE + COOLDOWN_DECLARE(sound_cooldown) + +/obj/vehicle/sealed/car/vim/examine(mob/user) + . = ..() + . += span_notice("[src] can be repaired with a welder.") + +/obj/vehicle/sealed/car/vim/obj_destruction(damage_flag) + new /obj/effect/decal/cleanable/oil(get_turf(src)) + do_sparks(5, TRUE, src) + visible_message(span_boldannounce("[src] blows apart!")) + return ..() + +/obj/vehicle/sealed/car/vim/mob_try_enter(mob/entering) + if(!isanimal(entering)) + return FALSE + var/mob/living/simple_animal/animal = entering + if(animal.mob_size != MOB_SIZE_TINY) + return FALSE + return ..() + +/obj/vehicle/sealed/car/vim/welder_act(mob/living/user, obj/item/tool) + . = ..() + . = TRUE + if(!tool.tool_start_check(user)) + return + if(being_repaired) + user.balloon_alert(user, "already being repaired!") + return + if(obj_integrity == max_integrity) + user.balloon_alert(user, "already fully repaired!") + return + + user.balloon_alert(user, "repairing [src]...") + audible_message(span_hear("You hear welding.")) + being_repaired = TRUE + if(!tool.use_tool(src, user, 3 SECONDS, volume=50)) + being_repaired = FALSE + user.balloon_alert(user, "interrupted!") + return + being_repaired = FALSE + + obj_integrity = min(obj_integrity + VIM_HEAL_AMOUNT, max_integrity) + user.balloon_alert(user, "[obj_integrity == max_integrity ? "fully " : ""]repaired [src]") + +/obj/vehicle/sealed/car/vim/mob_enter(mob/newoccupant, silent = FALSE) + . = ..() + update_appearance() + playsound(src, 'sound/machines/windowdoor.ogg', 50, TRUE) + if(obj_integrity == max_integrity) + SEND_SOUND(newoccupant, sound('sound/mecha/nominal.ogg',volume=50)) + +/obj/vehicle/sealed/car/vim/generate_actions() + initialize_controller_action_type(/datum/action/vehicle/sealed/climb_out/vim, VEHICLE_CONTROL_DRIVE) + initialize_controller_action_type(/datum/action/vehicle/sealed/noise/chime, VEHICLE_CONTROL_DRIVE) + initialize_controller_action_type(/datum/action/vehicle/sealed/noise/buzz, VEHICLE_CONTROL_DRIVE) + initialize_controller_action_type(/datum/action/vehicle/sealed/headlights/vim, VEHICLE_CONTROL_DRIVE) + +/obj/vehicle/sealed/car/vim/update_overlays() + . = ..() + var/static/piloted_overlay + var/static/headlights_overlay + if(isnull(piloted_overlay)) + piloted_overlay = iconstate2appearance(icon, "vim_piloted") + headlights_overlay = iconstate2appearance(icon, "vim_headlights") + + var/list/drivers = return_drivers() + if(drivers.len) + . += piloted_overlay + if(headlights_toggle) + . += headlights_overlay diff --git a/code/modules/vehicles/vehicle_actions.dm b/code/modules/vehicles/vehicle_actions.dm index 9944f979c87..5b0229d373f 100644 --- a/code/modules/vehicles/vehicle_actions.dm +++ b/code/modules/vehicles/vehicle_actions.dm @@ -216,6 +216,7 @@ 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) /datum/action/vehicle/sealed/dump_kidnapped_mobs @@ -311,3 +312,40 @@ vehicle.grinding = TRUE vehicle.icon_state = "[initial(vehicle.icon_state)]-grind" addtimer(CALLBACK(vehicle, /obj/vehicle/ridden/scooter/skateboard/.proc/grind), 2) + +//VIM ACTION DATUMS + +/datum/action/vehicle/sealed/climb_out/vim + name = "Eject From Mech" + icon_icon = 'icons/mob/actions/actions_mecha.dmi' + button_icon_state = "mech_eject" + +/datum/action/vehicle/sealed/noise + var/sound_path = 'sound/items/carhorn.ogg' + var/sound_message = "makes a sound." + +/datum/action/vehicle/sealed/noise/Trigger() + var/obj/vehicle/sealed/car/vim/vim_mecha = vehicle_entered_target + if(!COOLDOWN_FINISHED(vim_mecha, sound_cooldown)) + vim_mecha.balloon_alert(owner, "on cooldown!") + return + COOLDOWN_START(vim_mecha, sound_cooldown, VIM_SOUND_COOLDOWN) + vehicle_entered_target.visible_message(span_notice("[vehicle_entered_target] [sound_message]")) + playsound(vim_mecha, sound_path, 75) + +/datum/action/vehicle/sealed/noise/chime + name = "Chime!" + desc = "Affirmative!" + button_icon_state = "vim_chime" + sound_path = 'sound/machines/chime.ogg' + sound_message = "chimes!" + +/datum/action/vehicle/sealed/noise/buzz + name = "Buzz." + desc = "Negative!" + button_icon_state = "vim_buzz" + sound_path = 'sound/machines/buzz-sigh.ogg' + sound_message = "buzzes." + +/datum/action/vehicle/sealed/headlights/vim + button_icon_state = "vim_headlights" diff --git a/icons/mob/actions/actions_vehicle.dmi b/icons/mob/actions/actions_vehicle.dmi index 33247cc4f26..3ad64040513 100644 Binary files a/icons/mob/actions/actions_vehicle.dmi and b/icons/mob/actions/actions_vehicle.dmi differ diff --git a/icons/mob/aibots.dmi b/icons/mob/aibots.dmi index 02709ce5332..7b957084512 100644 Binary files a/icons/mob/aibots.dmi and b/icons/mob/aibots.dmi differ diff --git a/icons/obj/vehicles.dmi b/icons/obj/vehicles.dmi index c1ed2b4e3a4..9056106ea67 100644 Binary files a/icons/obj/vehicles.dmi and b/icons/obj/vehicles.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 70aeb76c573..6e1da1dbb5a 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3552,6 +3552,7 @@ #include "code\modules\vehicles\wheelchair.dm" #include "code\modules\vehicles\cars\car.dm" #include "code\modules\vehicles\cars\clowncar.dm" +#include "code\modules\vehicles\cars\vim.dm" #include "code\modules\vehicles\mecha\_mecha.dm" #include "code\modules\vehicles\mecha\mech_bay.dm" #include "code\modules\vehicles\mecha\mech_fabricator.dm"