Skip to content

Commit

Permalink
- Added href getter datum. Returns either what you want or null.
Browse files Browse the repository at this point in the history
- Moved byjax callback processing to JS part.
- Disabled exosuits verbs from showing when RMButtoning.
- Added radios to exosuits. Setting can be found in 'Electronics' menu.
- Exosuit maintenance can be initiated even if it's occupied. The pilot must permit maintenance through 'Permissions & Logging' - 'Permit maintenance protocols'. For combat exosuits it's disabled by default. While in maintenance mode, exosuit can't move or use equipment.
- Nerfed EMP effect on mechs.
- Fixed build_path for atmospheric monitor circuitboard design
- Bugfixing and bugmaking.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2343 316c924e-a436-60f5-8080-3fe189b3f50e
  • Loading branch information
panurgomatic committed Oct 11, 2011
1 parent 41e2684 commit 58bef9a
Show file tree
Hide file tree
Showing 14 changed files with 313 additions and 120 deletions.
56 changes: 56 additions & 0 deletions code/datums/helper_datums/topic_input.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/datum/topic_input
var/href
var/list/href_list

New(thref,list/thref_list)
href = thref
href_list = thref_list.Copy()
return

proc/get(i)
return listgetindex(href_list,i)

proc/getAndLocate(i)
var/t = get(i)
if(t)
t = locate(t)
return t || null

proc/getNum(i)
var/t = get(i)
if(t)
t = text2num(t)
return isnum(t) ? t : null

proc/getObj(i)
var/t = getAndLocate(i)
return isobj(t) ? t : null

proc/getMob(i)
var/t = getAndLocate(i)
return ismob(t) ? t : null

proc/getTurf(i)
var/t = getAndLocate(i)
return isturf(t) ? t : null

proc/getAtom(i)
return getType(i,/atom)

proc/getArea(i)
var/t = getAndLocate(i)
return isarea(t) ? t : null

proc/getStr(i)//params should always be text, but...
var/t = get(i)
return istext(t) ? t : null

proc/getType(i,type)
var/t = getAndLocate(i)
return istype(t,type) ? t : null

proc/getPath(i)
var/t = get(i)
if(t)
t = text2path(t)
return ispath(t) ? t : null
3 changes: 2 additions & 1 deletion code/game/mecha/combat/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
var/melee_can_hit = 1
var/list/destroyable_obj = list(/obj/mecha, /obj/structure/window, /obj/structure/grille, /turf/simulated/wall)
internal_damage_threshold = 50
maint_access = 0

/*
/obj/mecha/combat/verb/switch_weapon()
Expand Down Expand Up @@ -37,7 +38,7 @@

/obj/mecha/combat/melee_action(target as obj|mob|turf)
if(internal_damage&MECHA_INT_CONTROL_LOST)
target = pick(oview(1,src))
target = safepick(oview(1,src))
if(!melee_can_hit || !istype(target, /atom)) return
if(istype(target, /mob/living))
var/mob/living/M = target
Expand Down
1 change: 1 addition & 0 deletions code/game/mecha/combat/durand.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
set category = "Exosuit Interface"
set name = "Toggle defence mode"
set src in view(0)
set popup_menu = 0
if(usr!=src.occupant)
return
defence = !defence
Expand Down
1 change: 1 addition & 0 deletions code/game/mecha/combat/gygax.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
set category = "Exosuit Interface"
set name = "Toggle leg actuators overload"
set src in view(0)
set popup_menu = 0
if(usr!=src.occupant)
return
if(overload)
Expand Down
3 changes: 3 additions & 0 deletions code/game/mecha/combat/marauder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
set category = "Exosuit Interface"
set name = "Toggle thrusters"
set src in view(0)
set popup_menu = 0
if(usr!=src.occupant)
return
if(src.occupant)
Expand All @@ -136,6 +137,7 @@
set category = "Exosuit Interface"
set name = "Smoke"
set src in view(0)
set popup_menu = 0
if(usr!=src.occupant)
return
if(smoke_ready && smoke>0)
Expand All @@ -150,6 +152,7 @@
set category = "Exosuit Interface"
set name = "Zoom"
set src in view(0)
set popup_menu = 0
if(usr!=src.occupant)
return
if(src.occupant.client)
Expand Down
1 change: 1 addition & 0 deletions code/game/mecha/combat/phazon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
set category = "Exosuit Interface"
set name = "Change melee damage type"
set src in view(0)
set popup_menu = 0
if(usr!=src.occupant)
return
var/new_damtype = alert(src.occupant,"Melee Damage Type",null,"Brute","Fire","Toxic")
Expand Down
13 changes: 12 additions & 1 deletion code/game/mecha/equipment/tools/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -356,17 +356,20 @@
return
locked = target
chassis.occupant_message("Locked on [target]")
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
return
else if(target!=locked)
if(locked in view(chassis))
locked.throw_at(target, 14, 1.5)
locked = null
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
set_ready_state(0)
chassis.use_power(energy_drain)
do_after_cooldown()
else
chassis.occupant_message("Lock on [locked] disengaged.")
locked = null
chassis.occupant_message("Lock on [locked] disengaged.")
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
if(2)
if(!action_checks(target)) return
var/list/atoms = list()
Expand Down Expand Up @@ -425,6 +428,10 @@
..()
return

get_equip_info()
if(!chassis) return
return "<span style=\"color:[equip_ready?"#0f0":"#f00"];\">*</span>&nbsp;[src.name]"

proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob)
if(!action_checks(user))
return chassis.dynattackby(W,user)
Expand Down Expand Up @@ -474,6 +481,10 @@
..()
return

get_equip_info()
if(!chassis) return
return "<span style=\"color:[equip_ready?"#0f0":"#f00"];\">*</span>&nbsp;[src.name]"

proc/dynbulletdamage(var/obj/item/projectile/Proj)
if(!action_checks(src))
return chassis.dynbulletdamage(Proj)
Expand Down
45 changes: 23 additions & 22 deletions code/game/mecha/mech_fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@
if(istype(parts, /list))
for(var/i=1;i<=parts.len;i++)
var/path = parts[i]
parts[i] = new path(src)
var/part = new path(src)
if(part)
parts[i] = part
//debug below
ASSERT(istype(parts[i],/obj/item))
return
Expand Down Expand Up @@ -234,7 +236,7 @@
return 1
return 0

proc/build_part(var/obj/item/mecha_parts/part)
proc/build_part(var/obj/item/part)
if(!part) return
src.being_built = new part.type(src)
src.desc = "It's building [src.being_built]."
Expand All @@ -243,7 +245,6 @@
src.use_power = 2
src.updateUsrDialog()
sleep(get_construction_time_w_coeff(part))
//if(!src) return // you do not need to check it, all sleeping procedires will be terminated when src dies. -- rastaf0
src.use_power = 1
src.overlays -= "fab-active"
src.desc = initial(src.desc)
Expand Down Expand Up @@ -431,35 +432,32 @@

Topic(href, href_list)
..()
var/datum/topic_input/filter = new /datum/topic_input(href,href_list)
if(href_list["part_set"])
if(href_list["part_set"]=="clear")
src.part_set = null
else
src.part_set = href_list["part_set"]
screen = "parts"
if(href_list["part"])
var/list/part = locate(href_list["part"])
var/list/part = filter.getObj("part")
if(!processing_queue)
build_part(part)
else
add_to_queue(part)
if(href_list["add_to_queue"])
var/part = locate(href_list["add_to_queue"])
add_to_queue(part)
add_to_queue(filter.getObj("add_to_queue"))
return update_queue_on_page()
if(href_list["remove_from_queue"])
var/index = text2num(href_list["remove_from_queue"])
if(isnum(index))
remove_from_queue(index)
remove_from_queue(filter.getNum("remove_from_queue"))
return update_queue_on_page()
if(href_list["partset_to_queue"])
var/part_set = href_list["partset_to_queue"]
add_part_set_to_queue(part_set)
add_part_set_to_queue(filter.get("partset_to_queue"))
return update_queue_on_page()
if(href_list["process_queue"])
if(processing_queue || being_built)
return 0
spawn(-1) //don't wait for process_queue() to finish
spawn(-1)
if(processing_queue || being_built)
return 0
processing_queue = 1
process_queue()
processing_queue = 0
Expand All @@ -472,8 +470,8 @@
if(href_list["screen"])
src.screen = href_list["screen"]
if(href_list["queue_move"] && href_list["index"])
var/index = text2num(href_list["index"])
var/new_index = index + text2num(href_list["queue_move"])
var/index = filter.getNum("index")
var/new_index = index + filter.getNum("queue_move")
if(isnum(index) && isnum(new_index))
if(InRange(new_index,1,queue.len))
queue.Swap(index,new_index)
Expand All @@ -487,11 +485,12 @@
src.sync = !src.sync
//pr_auto_sync.toggle()
if(href_list["part_desc"])
var/obj/part = locate(href_list["part_desc"])
temp = {"<h1>[part] description:</h1>
[part.desc]<br>
<a href='?src=\ref[src];clear_temp=1'>Return</a>
"}
var/obj/part = filter.getObj("part_desc")
if(part)
temp = {"<h1>[part] description:</h1>
[part.desc]<br>
<a href='?src=\ref[src];clear_temp=1'>Return</a>
"}
if(href_list["remove_mat"] && href_list["material"])
temp = "Ejected [remove_material(href_list["material"],text2num(href_list["remove_mat"]))] of [href_list["material"]]<br><a href='?src=\ref[src];clear_temp=1'>Return</a>"
src.updateUsrDialog()
Expand Down Expand Up @@ -569,14 +568,16 @@
type = /obj/item/stack/sheet/clown
else
return 0
var/result = 0
var/obj/item/stack/sheet/res = new type(src)
var/total_amount = round(resources[mat_string]/res.perunit)
res.amount = min(total_amount,amount)
if(res.amount>0)
resources[mat_string] -= res.amount*res.perunit
res.Move(src.loc)
result = res.amount
else
del res
return res.amount
return result


Loading

0 comments on commit 58bef9a

Please sign in to comment.