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

Ground Vehicles. #390

Merged
merged 8 commits into from
Jan 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,11 @@
#include "code\modules\halo\turfs\covenant\floor.dm"
#include "code\modules\halo\turfs\covenant\materials.dm"
#include "code\modules\halo\turfs\covenant\walls.dm"
#include "code\modules\halo\vehicles\fuel.dm"
#include "code\modules\halo\vehicles\ghost.dm"
#include "code\modules\halo\vehicles\mongoose.dm"
#include "code\modules\halo\vehicles\vehiclebase.dm"
#include "code\modules\halo\vehicles\vehiclebase_weaponry.dm"
#include "code\modules\halo\weapons\ammo.dm"
#include "code\modules\halo\weapons\ammo_boxes.dm"
#include "code\modules\halo\weapons\dual_wielding.dm"
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
trigger_aiming(TARGET_CAN_CLICK)
return 1

if(!isturf(loc)) // This is going to stop you from telekinesing from inside a closet, but I don't shed many tears for that
if(!istype(loc,/obj/vehicles) && !isturf(loc)) // This is going to stop you from telekinesing from inside a closet, but I don't shed many tears for that
return

//Atoms on turfs (not on your person)
Expand Down
Binary file modified code/modules/halo/icons/Warthog.dmi
Binary file not shown.
37 changes: 37 additions & 0 deletions code/modules/halo/vehicles/fuel.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

#define REFILL_SUCCEED -1
#define REFILL_FAIL -2

/datum/fuel
var/name = "Fuel"

var/list/volume = list(0,100) //Current / Maximum

/datum/fuel/fusion
name = "Fusion Fuel"

volume = list(100,100)

/datum/fuel/proc/attempt_refill(var/amount)
var/potential_volume = volume[1] + amount
if(potential_volume > volume[2]) //Used when refilling to make sure we don't set the fuel in the giving object to 0 whilst hitting the vehicle's fuel cap.
volume [1] = volume[2]
return (potential_volume - volume[2])
else if(potential_volume < 0) //Ensuring we don't set the fuel to negative levels.
return REFILL_FAIL
else
volume[1] = potential_volume //No other issues, so we can set the fuel level.
return REFILL_SUCCEED

/datum/fuel/proc/drain_fuel(var/amount)
return attempt_refill(-amount)

/obj/item/fuel_item
name = "Fuel Item"

var/contained_fuel = newlist()//A list of fuel datums that this canister contains.

/obj/item/fuel_item/debug
name = "Fuel Item - Debug"

contained_fuel = newlist(/datum/fuel/fusion)
59 changes: 59 additions & 0 deletions code/modules/halo/vehicles/ghost.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

/obj/vehicles/ghost
name = "Type-32 Rapid Assault Vehicle"
desc = ""

passengers = list(0)
gunners = list(1)

health = list(400,400)

bound_height = 32
bound_width = 64

sprite_offsets = list("1" = list(16,2),"2" = list(16,2),"4" = list(10,2),"8" = list(22,2))
damage_resistances = list("brute" = 35.0, "burn" = 20.0,"emp" = 15)

controller = /datum/vehicle_control/base

vehicle_move_delay = 1.5

gunner_weapons = list(/obj/item/weapon/gun/vehicle_turret/covenant/ghost)
icon = 'code/modules/halo/vehicles/ghost.dmi'
icon_state = "base"

/obj/vehicles/ghost/assign_driver(var/mob/user)
. = ..()
assign_gunner(user)

/obj/vehicles/ghost/unassign_driver(var/mob/user)
. = ..()
unassign_gunner(user)

/obj/vehicles/ghost/render_mob_sprites()
underlays.Cut()
if(!driver)
return
var/image/driver_image = image(driver)
var/list/offsets = list()
if(num2text(dir) in sprite_offsets)
offsets = sprite_offsets[num2text(dir)]
if(offsets.len)
driver_image.pixel_x = offsets[1]
driver_image.pixel_y = offsets[2]

underlays += driver_image

/obj/item/weapon/gun/vehicle_turret/covenant/ghost
name = "Type-32 RAV Plasma Weapon"

icon = 'code/modules/halo/weapons/turrets/turret_items.dmi'
icon_state = "chaingun_obj"
item_state = ""

projectile_fired = /obj/item/projectile/covenant/plasmarifle
fire_sound = 'code/modules/halo/sounds/plasrifle3burst.ogg'
burst_delay = 0.3 SECONDS
fire_delay = 1.5 SECONDS

burst = 4
Binary file added code/modules/halo/vehicles/ghost.dmi
Binary file not shown.
53 changes: 53 additions & 0 deletions code/modules/halo/vehicles/mongoose.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#define MONGOOSE_BASE_PASSENGER_OFFSETS list("1" = list(0,13),"2" = list(0,13),"4" = list(-10,13),"8" = list(10,13))

/obj/vehicles/mongoose
name = "M274 Ultra-Light All-Terrain Vehicle"
desc = "Also known as the \"Mongoose\""

icon = 'code/modules/halo/vehicles/mongoose.dmi'
icon_state = "base"

passengers = list(1)
gunners = list(0)

bound_height = 32
bound_width = 32

sprite_offsets = list("1" = list(0,3),"2" = list(0,3),"4" = list(0,3),"8" = list(0,3))
damage_resistances = list("brute" = 30.0, "burn" = 25.0,"emp" = 15.0)

controller = /datum/vehicle_control/base

vehicle_move_delay = 1

gunner_weapons = list()

/obj/vehicles/mongoose/render_mob_sprites()
underlays.Cut()
overlays.Cut()
if(!driver && passengers.len <= 1)
return
var/image/passenger_image
for(var/mob/M in passengers)
passenger_image = image(M)
var/image/driver_image = image(driver)
var/list/offsets = list()
if(num2text(dir) in sprite_offsets)
offsets = sprite_offsets[num2text(dir)]
if(offsets.len)
driver_image.pixel_x = offsets[1]
driver_image.pixel_y = offsets[2]
if(passenger_image)
var/list/passenger_offsets = MONGOOSE_BASE_PASSENGER_OFFSETS[num2text(dir)]
passenger_image.pixel_x = offsets[1] + passenger_offsets[1]
passenger_image.pixel_y = offsets[2] + passenger_offsets[2]
if(dir == SOUTH)
underlays += driver_image
if(passenger_image)
underlays += passenger_image
else
overlays += driver_image
if(passenger_image)
overlays += passenger_image

#undef MONGOOSE_BASE_PASSENGER_OFFSETS
Binary file added code/modules/halo/vehicles/mongoose.dmi
Binary file not shown.
Loading