Fixes for package wrap, added proper buttons and hotkeys to the gun system, fixed PDA manifest.

This commit is contained in:
SkyMarshal
2012-03-03 15:08:01 -07:00
parent 1e4bdf7183
commit 1107f6e768
15 changed files with 102 additions and 61 deletions
+1
View File
@@ -44,6 +44,7 @@
var/obj/screen/gun/item/item_use_icon = null
var/obj/screen/gun/move/gun_move_icon = null
var/obj/screen/gun/run/gun_run_icon = null
var/obj/screen/gun/mode/gun_setting_icon
var/total_luminosity = 0 //This controls luminosity for mobs, when you pick up lights and such this is edited. If you want the mob to use lights it must update its lum in its life proc or such. Note clamp this value around 7 or such to prevent massive light lag.
var/last_luminosity = 0
+4 -3
View File
@@ -44,9 +44,10 @@
#define ui_inv3 "SOUTH-1,3"
#define ui_gun1 "WEST,NORTH"
#define ui_gun2 "WEST+1,NORTH"
#define ui_gun3 "WEST+2,NORTH"
#define ui_gun1 "SOUTH,8"
#define ui_gun2 "SOUTH,9"
#define ui_gun3 "SOUTH,10"
#define ui_gun_select "SOUTH-1,9"
+2
View File
@@ -149,6 +149,8 @@
src.welded =! src.welded
for(var/mob/M in viewers(src))
M.show_message("\red [src] has been [welded?"welded shut":"unwelded"] by [user.name].", 3, "\red You hear welding.", 2)
else if(istype(W,/obj/item/weapon/packageWrap))
return
else
src.attack_hand(user)
return
+3
View File
@@ -333,6 +333,7 @@
/obj/item/device/pda/Topic(href, href_list)
..()
var/mob/living/U = usr
U.last_target_click = world.time
//Looking for master was kind of pointless since PDAs don't appear to have one.
if ((src in U.contents) || ( istype(loc, /turf) && in_range(src, U) ) )
if ( !(U.stat || U.restrained()) )
@@ -382,6 +383,8 @@
mode = 2
if("21")//Read messeges
mode = 21
if("41")//Read messeges
mode = 41
if("3")//Atmos scan
mode = 3
if("4")//Redirects to hub
@@ -291,6 +291,8 @@
mymob.rest.name = "rest"
mymob.rest.screen_loc = ui_rest
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
mymob.zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel.overlays = null
@@ -298,6 +300,6 @@
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.hands, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach )
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.hands, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep, mymob.gun_setting_icon) //, mymob.mach )
mymob.client.screen += src.adding + src.other
+3 -1
View File
@@ -663,10 +663,12 @@
mymob.zone_sel.overlays = null
mymob.zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
mymob.client.screen = null
//, mymob.i_select, mymob.m_select
mymob.client.screen += list( mymob.pain, mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.hands, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach )
mymob.client.screen += list( mymob.pain, mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.hands, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep, mymob.gun_setting_icon) //, mymob.mach )
mymob.client.screen += src.adding + src.other
//if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo
+3 -1
View File
@@ -563,10 +563,12 @@
mymob.zone_sel.overlays = null
mymob.zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
mymob.client.screen = null
//, mymob.i_select, mymob.m_select
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.hands, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach )
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.hands, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep, mymob.gun_setting_icon) //, mymob.mach )
mymob.client.screen += src.adding + src.other
//if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo
+3 -1
View File
@@ -242,9 +242,11 @@
mymob.zone_sel.overlays = null
mymob.zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach )
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep, mymob.gun_setting_icon) //, mymob.mach )
mymob.client.screen += src.adding + src.other
return
+22 -18
View File
@@ -30,6 +30,7 @@
name = "gun"
icon = 'screen1.dmi'
master = null
dir = 1
move
name = "Allow Walking"
@@ -46,6 +47,12 @@
icon_state = "no_item"
screen_loc = ui_gun1
mode
name = "Toggle Gun Mode"
desc = "The shortcut key for this is \"F6\""
icon_state = "gun"
screen_loc = ui_gun_select
/obj/screen/zone_sel/MouseDown(location, control,params)
// Changes because of 4.0
var/list/PL = params2list(params)
@@ -590,78 +597,75 @@
usr:module_active = null
if("Allow Walking")
if(gun_click_time > world.time - 15) //give them 1.5 seconds between mode changes.
usr << "You need to wait some before you can change what they can do!"
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.AllowTargetMove()
icon_state = "walking"
dir = (dir%2)+1
name = "Disallow Walking"
gun_click_time = world.time
if("Disallow Walking")
if(gun_click_time > world.time - 15) //give them 1.5 seconds between mode changes.
usr << "You need to wait some before you can change what they can do!"
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.AllowTargetMove()
icon_state = "no_walk"
dir = (dir%2)+1
name = "Allow Walking"
gun_click_time = world.time
if("Allow Running")
if(gun_click_time > world.time - 15) //give them 1.5 seconds between mode changes.
usr << "You need to wait some before you can change what they can do!"
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.AllowTargetRun()
icon_state = "running"
dir = (dir%2)+1
name = "Disallow Running"
gun_click_time = world.time
if("Disallow Running")
if(gun_click_time > world.time - 15) //give them 1.5 seconds between mode changes.
usr << "You need to wait some before you can change what they can do!"
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.AllowTargetRun()
icon_state = "no_run"
dir = (dir%2)+1
name = "Allow Running"
gun_click_time = world.time
if("Allow Item Use")
if(gun_click_time > world.time - 15) //give them 1.5 seconds between mode changes.
usr << "You need to wait some before you can change what they can do!"
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
name = "Disallow Item Use"
icon_state = "act_throw_off"
dir = (dir%2)+1
usr.AllowTargetClick()
gun_click_time = world.time
if("Disallow Item Use")
if(gun_click_time > world.time - 15) //give them 1.5 seconds between mode changes.
usr << "You need to wait some before you can change what they can do!"
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
name = "Allow Item Use"
icon_state = "no_item"
dir = (dir%2)+1
usr.AllowTargetClick()
gun_click_time = world.time
if("Toggle Gun Mode")
usr.ToggleGunMode()
else
DblClick()
return
+43 -29
View File
@@ -190,42 +190,43 @@
afterattack(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, flag, params)
if(flag) return //we're placing gun on a table or in backpack
if(istype(target, /obj/machinery/recharger) && istype(src, /obj/item/weapon/gun/energy)) return//Shouldnt flag take care of this?
PreFire(A,user,params)
if(user && user.gun_mode)
PreFire(A,user,params)
else
Fire(A,user,params)
//Compute how to fire.....
proc/PreFire(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, params)
if(usr.a_intent in list("help","grab","disarm"))
//GraphicTrace(usr.x,usr.y,A.x,A.y,usr.z)
if(lock_time > world.time - 2) return
if(!ismob(A))
//GraphicTrace(usr.x,usr.y,A.x,A.y,usr.z)
if(lock_time > world.time - 2) return
if(!ismob(A))
// var/mob/M = locate() in range(0,A)
// if(M && !ismob(A))
// if(M.type == /mob)
// return FindTarget(M,user,params)
var/mob/M = GunTrace(usr.x,usr.y,A.x,A.y,usr.z,usr)
if(M && ismob(M) && !target)
Aim(M)
return
if(ismob(A) && target != A)
Aim(A)
else if(lock_time < world.time + 10)
Fire(A,user,params)
else if(!target)
Fire(A,user,params)
var/mob/M = GunTrace(usr.x,usr.y,A.x,A.y,usr.z,usr)
if(M && ismob(M) && !target && !M.client.admin_invis)
Aim(M)
return
if(ismob(A) && target != A)
Aim(A)
else if(lock_time < world.time + 10)
Fire(A,user,params)
else if(!target)
Fire(A,user,params)
//else
//var/item/gun/G = usr.OHand
//if(!G)
//Fire(A,0)
//else if(istype(G))
//G.Fire(A,3)
//Fire(A,2)
//else
//var/item/gun/G = usr.OHand
//if(!G)
//Fire(A,0)
//else if(istype(G))
//G.Fire(A,3)
//Fire(A,2)
//else
//Fire(A)
var/dir_to_fire = sd_get_approx_dir(usr,A)
if(dir_to_fire != usr.dir)
usr.dir = dir_to_fire
else
Fire(A, user)
//Fire(A)
var/dir_to_fire = sd_get_approx_dir(usr,A)
if(dir_to_fire != usr.dir)
usr.dir = dir_to_fire
//Yay, math!
@@ -372,6 +373,7 @@ mob/var
target_can_move = 0
target_can_run = 0
target_can_click = 0
gun_mode = 0
mob/Move()
. = ..()
for(var/obj/item/weapon/gun/G in targeted_by)
@@ -438,4 +440,16 @@ mob/verb
if(!target_can_click)
G.target << "Your character may now <b>use items</b> at the discretion of their targeter."
else
G.target << "\red <b>Your character will now be shot if they use items.</b>"
G.target << "\red <b>Your character will now be shot if they use items.</b>"
ToggleGunMode()
set hidden = 1
spawn(1) gun_mode = !gun_mode
if(!gun_mode)
// winset(usr,"default.target_can_click","is-flat=true;border=sunken")
usr << "You will now take people captive."
else
// winset(usr,"default.target_can_click","is-flat=false;border=none")
usr << "You will now shoot where you target."
if(usr.gun_setting_icon)
usr.gun_setting_icon.dir = (usr.gun_setting_icon.dir%2)+1
+5 -6
View File
@@ -172,7 +172,7 @@
afterattack(var/obj/target as obj, mob/user as mob)
if(istype(target, /obj/structure/table) || istype(target, /obj/structure/rack))
if(istype(target, /obj/structure/table) || istype(target, /obj/structure/rack) || istype(target,/obj/item/smallDelivery))
return
if(target.anchored)
return
@@ -193,17 +193,16 @@
src.amount -= 1
else if (istype(target, /obj/structure/closet/crate))
var/obj/structure/closet/crate/O = target
if (src.amount > 3)
if (src.amount > 3 && !O.opened)
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.wrapped = O
O.loc = P
src.amount -= 3
else
else if(src.amount > 3)
user << "\blue You need more paper."
else if (istype (target, /obj/structure/closet))
var/obj/structure/closet/O = target
if (src.amount > 3)
O.close()
if (src.amount > 3 && !O.opened)
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.wrapped = O
P.waswelded = O.welded
@@ -211,7 +210,7 @@
O.welded = 1
O.loc = P
src.amount -= 3
else
else if(src.amount > 3)
user << "\blue You need more paper."
else
user << "\blue The object you are trying to wrap is unsuitable for the sorting machinery!"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 29 KiB

+10 -1
View File
@@ -131,13 +131,21 @@ macro "macro"
name = "F3"
command = "say"
is-disabled = false
elem
name = "F4"
command = "me"
is-disabled = false
elem
name = "F5"
command = "asay"
is-disabled = false
elem
name = "F6"
command = "ToggleGunMode"
is-disabled = false
macro "tcside"
macro "vending"
elem
name = "NORTHEAST"
@@ -292,6 +300,7 @@ menu "menu"
is-disabled = false
saved-params = "is-checked"
window "Telecomms IDE"
elem "Telecomms IDE"
type = MAIN