mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
- Mech pilots are completely immune to airlock electrocution from now on.
- Yo dawg we herd yo dislike errors, so we removed a link from yo link. - Added health for space pods. - 2 projectile sprite. - Misc. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1520 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -58,6 +58,7 @@ Data storage vars:
|
||||
var/state = 0
|
||||
|
||||
New(list/arguments=null,autostart=1)
|
||||
delay = delay>0?(delay):1
|
||||
if(forbid_garbage) //prevents garbage collection with tag != null
|
||||
tag = "\ref[src]"
|
||||
set_process_args(arguments)
|
||||
@@ -73,13 +74,10 @@ Data storage vars:
|
||||
src.stop()
|
||||
return 0
|
||||
result = src.process(arglist(arg_list))
|
||||
if(src.delay>0)
|
||||
for(var/sleep_time=src.delay;sleep_time>0;sleep_time--) //uhh, this is ugly. But I see no other way to terminate sleeping proc. Such disgrace.
|
||||
if(!src.control_switch)
|
||||
return 0
|
||||
sleep(1)
|
||||
else
|
||||
sleep(src.delay) //delay can also be 0 and -1
|
||||
return 0
|
||||
|
||||
proc/start(list/arguments=null)
|
||||
@@ -126,7 +124,7 @@ Data storage vars:
|
||||
|
||||
proc/set_delay(new_delay)
|
||||
if(isnum(new_delay))
|
||||
delay = new_delay
|
||||
delay = new_delay>0?(new_delay):1
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
proc/spawn_asteroid(var/atom/start_loc,var/type,var/size,var/richness)//type: 0 or null - random, 1 - nothing, 2 - iron, 3 - silicon
|
||||
if(start_loc.x - size < 5 || start_loc.x + size >= world.maxx - 5 || start_loc.y - size < 5 || start_loc.y + size > world.maxy -5)
|
||||
return 0
|
||||
if(!size)
|
||||
size = pick(100;2,50;3,35;4,25;6,10;12)
|
||||
if(start_loc.x - size < 5 || start_loc.x + size >= world.maxx - 5 || start_loc.y - size < 5 || start_loc.y + size > world.maxy -5)
|
||||
return 0
|
||||
if(!type)
|
||||
type = pick(50;1,2,3)
|
||||
if(!richness)
|
||||
|
||||
@@ -19,6 +19,14 @@
|
||||
if(src.check_access(null))
|
||||
if(density)
|
||||
open()
|
||||
else if(istype(AM, /obj/mecha))
|
||||
var/obj/mecha/mecha = AM
|
||||
if(density)
|
||||
if(mecha.occupant && src.allowed(mecha.occupant))
|
||||
open()
|
||||
else
|
||||
flick("door_deny", src)
|
||||
|
||||
|
||||
/obj/machinery/door/proc/bumpopen(mob/user as mob)
|
||||
if (src.operating)
|
||||
|
||||
@@ -43,7 +43,8 @@
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/get_equip_info()
|
||||
return "<span style=\"color:[equip_ready?"#0f0":"#f00"];\">*</span> [src.name]"
|
||||
if(!chassis) return
|
||||
return "<span style=\"color:[equip_ready?"#0f0":"#f00"];\">*</span> [chassis.selected==src?"<b>":"<a href='?src=\ref[chassis];select_equip=\ref[src]'>"][src.name][chassis.selected==src?"</b>":"</a>"]"
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/is_ranged()//add a distance restricted equipment. Why not?
|
||||
return range&RANGED
|
||||
|
||||
@@ -71,8 +71,7 @@
|
||||
|
||||
/obj/beam/a_laser/pulse_laser/heavy_pulse
|
||||
name = "heavy pulse laser"
|
||||
icon = 'xcomalien.dmi'
|
||||
icon_state = "plasma"
|
||||
icon_state = "pulse1_bl"
|
||||
life = 20
|
||||
|
||||
Bump(atom/A)
|
||||
|
||||
@@ -246,14 +246,14 @@
|
||||
return
|
||||
|
||||
proc/add_to_queue(part)
|
||||
if(!istype(queue, /list))
|
||||
if(!istype(queue))
|
||||
queue = list()
|
||||
if(part)
|
||||
queue[++queue.len] = part
|
||||
return queue.len
|
||||
|
||||
proc/remove_from_queue(index)
|
||||
if(!isnum(index) || !istype(queue, /list) || (index<1 || index>queue.len))
|
||||
if(!isnum(index) || !istype(queue) || (index<1 || index>queue.len))
|
||||
return 0
|
||||
queue.Cut(index,++index)
|
||||
return 1
|
||||
@@ -277,13 +277,13 @@
|
||||
|
||||
proc/list_queue()
|
||||
var/output = "<b>Queue contains:</b>"
|
||||
if(!istype(queue, /list) || !queue.len)
|
||||
if(!istype(queue) || !queue.len)
|
||||
output += "<br>Nothing"
|
||||
else
|
||||
output += "<ol>"
|
||||
for(var/i=1;i<=queue.len;i++)
|
||||
var/atom/part = listgetindex(src.queue, i)
|
||||
if(part)
|
||||
if(istype(part))
|
||||
output += "<li[!check_resources(part)?" style='color: #f00;'":null]>[part.name] - [i>1?"<a href='?src=\ref[src];queue_move=-1;index=[i]' class='arrow'>↑</a>":null] [i<queue.len?"<a href='?src=\ref[src];queue_move=+1;index=[i]' class='arrow'>↓</a>":null] <a href='?src=\ref[src];remove_from_queue=[i]'>Remove</a></li>"
|
||||
output += "</ol>"
|
||||
output += "\[<a href='?src=\ref[src];process_queue=1'>Process queue</a> | <a href='?src=\ref[src];clear_queue=1'>Clear queue</a>\]"
|
||||
|
||||
@@ -130,8 +130,7 @@
|
||||
return
|
||||
if(internal_damage&MECHA_INT_CONTROL_LOST)
|
||||
target = pick(view(3,target))
|
||||
var/dist = get_dist(src, target)
|
||||
if(dist>1)
|
||||
if(get_dist(src, target)>1)
|
||||
if(selected && selected.is_ranged())
|
||||
selected.action(target)
|
||||
else if(selected && selected.is_melee())
|
||||
@@ -235,10 +234,7 @@
|
||||
// src.inertia_dir = null
|
||||
if(istype(obstacle, /obj))
|
||||
var/obj/O = obstacle
|
||||
if(istype(O , /obj/machinery/door))
|
||||
if(src.occupant)
|
||||
O.Bumped(src.occupant)
|
||||
else if(istype(O, /obj/portal)) //derpfix
|
||||
if(istype(O, /obj/portal)) //derpfix
|
||||
src.anchored = 0
|
||||
O.HasEntered(src)
|
||||
spawn(0)//countering portal teleport spawn(0), hurr
|
||||
@@ -1146,7 +1142,7 @@
|
||||
return
|
||||
var/output = "<b>Equipment:</b><div style=\"margin-left: 15px;\">"
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/MT in equipment)
|
||||
output += "[selected==MT?"<b id='\ref[MT]'>":"<a id='\ref[MT]' href='?src=\ref[src];select_equip=\ref[MT]'>"][MT.get_equip_info()][selected==MT?"</b>":"</a>"]<br>"
|
||||
output += "<div id='\ref[MT]'>[MT.get_equip_info()]</div>"
|
||||
output += "</div>"
|
||||
return output
|
||||
|
||||
|
||||
@@ -152,12 +152,16 @@
|
||||
var/datum/global_iterator/space_ship_speed_increment/pr_speed_increment
|
||||
var/last_relay = 0
|
||||
var/obj/machinery/portable_atmospherics/canister/internal_tank
|
||||
var/health = 100
|
||||
var/datum/effects/system/spark_spread/spark_system = new
|
||||
|
||||
New()
|
||||
..()
|
||||
internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
|
||||
pr_inertial_movement = new /datum/global_iterator/space_ship_inertial_movement(list(src),0)
|
||||
pr_speed_increment = new /datum/global_iterator/space_ship_speed_increment(list(src),0)
|
||||
src.spark_system.set_up(2, 0, src)
|
||||
src.spark_system.attach(src)
|
||||
return
|
||||
|
||||
proc/inspace()
|
||||
@@ -191,10 +195,20 @@
|
||||
if(istype(A))
|
||||
step(A, src.dir)
|
||||
else
|
||||
if(pr_inertial_movement.cur_delay<2)
|
||||
take_damage(25)
|
||||
pr_speed_increment.stop()
|
||||
pr_inertial_movement.stop()
|
||||
pr_inertial_movement.cur_delay = pr_inertial_movement.max_delay
|
||||
pr_inertial_movement.desired_delay = pr_inertial_movement.max_delay
|
||||
return
|
||||
|
||||
proc/take_damage(value)
|
||||
if(isnum(value))
|
||||
src.health -= value
|
||||
if(src.health>0)
|
||||
src.spark_system.start()
|
||||
world << "[src] health is [health]"
|
||||
else
|
||||
src.ex_act(1)
|
||||
return
|
||||
|
||||
process()
|
||||
@@ -223,7 +237,7 @@
|
||||
else if (src.can_rotate && direction & 8)
|
||||
src.dir = turn(src.dir, 90)
|
||||
if(speed_change)
|
||||
//user << "Desired speed: [get_desired_speed()]%"
|
||||
// user << "Desired speed: [get_desired_speed()]%"
|
||||
src.pr_speed_increment.start()
|
||||
src.pr_inertial_movement.start()
|
||||
return
|
||||
@@ -242,6 +256,11 @@
|
||||
desired_delay = max_delay
|
||||
cur_delay = max_delay
|
||||
|
||||
stop()
|
||||
src.cur_delay = max_delay
|
||||
src.desired_delay = max_delay
|
||||
return ..()
|
||||
|
||||
process(var/obj/machinery/vehicle/space_ship/SS as obj)
|
||||
if(cur_delay >= max_delay)
|
||||
return src.stop()
|
||||
@@ -254,10 +273,6 @@
|
||||
*/
|
||||
if(!step(SS, SS.dir) || !SS.inspace())
|
||||
src.stop()
|
||||
src.cur_delay = max_delay
|
||||
src.desired_delay = max_delay
|
||||
if(src.delay<2)
|
||||
SS.ex_act(2)
|
||||
return
|
||||
|
||||
proc/set_desired_delay(var/num as num)
|
||||
@@ -265,16 +280,16 @@
|
||||
return
|
||||
|
||||
/datum/global_iterator/space_ship_speed_increment
|
||||
delay = 4
|
||||
delay = 5
|
||||
|
||||
process(var/obj/machinery/vehicle/space_ship/SS as obj)
|
||||
if(SS.pr_inertial_movement.desired_delay!=SS.pr_inertial_movement.cur_delay)
|
||||
var/delta = SS.pr_inertial_movement.desired_delay - SS.pr_inertial_movement.cur_delay
|
||||
SS.pr_inertial_movement.cur_delay += delta>0?1:-1
|
||||
/*
|
||||
/*
|
||||
for(var/mob/M in SS)
|
||||
M << "Current speed: [SS.get_current_speed()]"
|
||||
*/
|
||||
*/
|
||||
else
|
||||
src.stop()
|
||||
return
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 13 KiB |
Reference in New Issue
Block a user