Adds in a roofless Sports car.

This commit adds a new subtype of the cargo train which looks like a
retro-ish sports car. It is unobtainable as of this PR by any means
but admin spawning.
This commit is contained in:
Nienhaus
2015-04-20 07:10:01 -07:00
committed by Tigercat2000
parent da873f0a7e
commit 26574e0c16
4 changed files with 58 additions and 2 deletions
@@ -0,0 +1,52 @@
//rename to sportscar if you need
//mostly, my changes just update the C.pixel_ y and x on every iteration of the overlay update proc, since default vehicle code //only does that upon entering. Watch the weird formatting pastebin introduces.
/obj/vehicle/train/cargo/engine/sportscar
name = "sports car"
desc = "A very luxurious vehicle."
icon = 'icons/vehicles/sportscar.dmi'
icon_state = "sportscar"
emagged = 0
health = 100
charge_use = 0
bound_width = 64
bound_height = 64
movable = 0
/obj/vehicle/train/cargo/engine/sportscar/proc/update_dir_sportscar_overlays()
var/atom/movable/C = src.load
src.overlays = null
if(src.dir == NORTH||SOUTH||WEST)
if(src.dir == NORTH)
var/image/I = new(icon = 'icons/vehicles/sportscar.dmi', icon_state = "sportscar_north", layer = src.layer + 0.2) //over mobs
src.overlays += I
src.mob_offset_x = 2
src.mob_offset_y = 20
else if(src.dir == SOUTH)
var/image/I = new(icon = 'icons/vehicles/sportscar.dmi', icon_state = "sportscar_south", layer = src.layer + 0.2) //over mobs
overlays += I
src.mob_offset_x = 20
src.mob_offset_y = 27
else if(src.dir == WEST)
src.mob_offset_x = 34
src.mob_offset_y = 10
var/image/I = new(icon = 'icons/vehicles/sportscar.dmi', icon_state = "sportscar_west", layer = src.layer + 0.2) //over mobs
src.overlays += I
else if(src.dir == EAST)
var/image/I = new(icon = 'icons/vehicles/sportscar.dmi', icon_state = "sportscar_east", layer = src.layer + 0.2) //over mobs
src.mob_offset_x = 20
src.mob_offset_y = 23
src.overlays += I
if(ismob(C))
C.pixel_y = src.mob_offset_y
C.pixel_x = src.mob_offset_x
/obj/vehicle/train/cargo/engine/sportscar/New()
..()
update_dir_sportscar_overlays()
/obj/vehicle/train/cargo/engine/sportscar/Move()
..()
update_dir_sportscar_overlays()
+5 -2
View File
@@ -28,8 +28,10 @@
var/load_item_visible = 1 //set if the loaded item should be overlayed on the vehicle sprite
var/load_offset_x = 0 //pixel_x offset for item overlay
var/load_offset_y = 0 //pixel_y offset for item overlay
var/mob_offset_x = 0 //pixel_x offset for mob overlay
var/mob_offset_y = 0 //pixel_y offset for mob overlay
//-------------------------------------------
// Standard procs
//-------------------------------------------
@@ -290,10 +292,11 @@
load = C
if(load_item_visible)
C.pixel_x += load_offset_x
if(ismob(C))
if(ismob(C) && mob_offset_x != 0 && mob_offset_y != 0) //if the offset is not set, use load offset
C.pixel_x += mob_offset_x
C.pixel_y += mob_offset_y
else
C.pixel_x += load_offset_x
C.pixel_y += load_offset_y
C.layer = layer + 0.1 //so it sits above the vehicle