Merge pull request #1527 from Mloc/tg-fix2

Small fixes, a new atom flag, a fix for alt-gr, and some cyborg changes.
This commit is contained in:
Aranclanos
2013-10-09 13:15:52 -07:00
12 changed files with 164 additions and 117 deletions
+1
View File
@@ -59,6 +59,7 @@
#define FPRINT 256 // takes a fingerprint
#define ON_BORDER 512 // item has priority to check when entering or leaving
#define NOBLUDGEON 4 // when an item has this it produces no "X has been hit by Y with Z" message in the default attackby()
#define NOBLOODY 2048 // used by objects that don't want to get bloodied
#define GLASSESCOVERSEYES 1024
#define MASKCOVERSEYES 1024 // get rid of some of the other retardation in these flags
+4 -3
View File
@@ -39,12 +39,13 @@
if(modifiers["shift"])
ShiftClickOn(A)
return
if(modifiers["alt"]) // alt and alt-gr (rightalt)
AltClickOn(A)
return
if(modifiers["ctrl"])
CtrlClickOn(A)
return
if(modifiers["alt"])
AltClickOn(A)
return
if(control_disabled || stat || world.time <= next_move) return
next_move = world.time + 9
+4 -4
View File
@@ -49,13 +49,13 @@
if(modifiers["shift"])
ShiftClickOn(A)
return
if(modifiers["alt"]) // alt and alt-gr (rightalt)
AltClickOn(A)
return
if(modifiers["ctrl"])
CtrlClickOn(A)
return
if(modifiers["alt"])
AltClickOn(A)
return
if(stat || paralysis || stunned || weakened)
return
+9 -3
View File
@@ -22,12 +22,12 @@
if(modifiers["shift"])
ShiftClickOn(A)
return
if(modifiers["alt"]) // alt and alt-gr (rightalt)
AltClickOn(A)
return
if(modifiers["ctrl"])
CtrlClickOn(A)
return
if(modifiers["alt"])
AltClickOn(A)
return
if(stat || lockcharge || weakened || stunned || paralysis)
return
@@ -94,6 +94,12 @@
W.afterattack(A, src, 0, params)
return
return
//Middle click cycles through selected modules.
/mob/living/silicon/robot/MiddleClickOn(var/atom/A)
cycle_modules()
return
/*
As with AI, these are not used in click code,
because the code for robots is specific, not generic.
+6 -27
View File
@@ -292,37 +292,16 @@
usr:uneq_active()
if("module1")
if(usr:module_state_1)
if(usr:module_active != usr:module_state_1)
usr:inv1.icon_state = "inv1 +a"
usr:inv2.icon_state = "inv2"
usr:inv3.icon_state = "inv3"
usr:module_active = usr:module_state_1
else
usr:inv1.icon_state = "inv1"
usr:module_active = null
if(istype(usr, /mob/living/silicon/robot))
usr:toggle_module(1)
if("module2")
if(usr:module_state_2)
if(usr:module_active != usr:module_state_2)
usr:inv1.icon_state = "inv1"
usr:inv2.icon_state = "inv2 +a"
usr:inv3.icon_state = "inv3"
usr:module_active = usr:module_state_2
else
usr:inv2.icon_state = "inv2"
usr:module_active = null
if(istype(usr, /mob/living/silicon/robot))
usr:toggle_module(2)
if("module3")
if(usr:module_state_3)
if(usr:module_active != usr:module_state_3)
usr:inv1.icon_state = "inv1"
usr:inv2.icon_state = "inv2"
usr:inv3.icon_state = "inv3 +a"
usr:module_active = usr:module_state_3
else
usr:inv3.icon_state = "inv3"
usr:module_active = null
if(istype(usr, /mob/living/silicon/robot))
usr:toggle_module(3)
else
return 0
+1
View File
@@ -247,6 +247,7 @@ var/list/blood_splatter_icons = list()
//returns 1 if made bloody, returns 0 otherwise
/atom/proc/add_blood(mob/living/carbon/M)
if(flags & NOBLOODY) return
if(!initial(icon) || !initial(icon_state))
return 0
if(!istype(M))
@@ -5,13 +5,18 @@
anchored = 1
w_class = 4.0
canhear_range = 2
flags = FPRINT | CONDUCT | TABLEPASS | NOBLOODY
var/number = 0
var/anyai = 1
var/mob/living/silicon/ai/ai = list()
var/last_tick //used to delay the powercheck
/obj/item/device/radio/intercom/New()
spawn(5)
checkpower()
..()
processing_objects += src
/obj/item/device/radio/intercom/Del()
processing_objects -= src
..()
/obj/item/device/radio/intercom/attack_ai(mob/user as mob)
@@ -51,10 +56,9 @@
return
..()
/obj/item/device/radio/intercom/proc/checkpower()
// Simple loop, checks for power. Strictly for intercoms
while(src)
/obj/item/device/radio/intercom/process()
if(((world.timeofday - last_tick) > 30) || ((world.timeofday - last_tick) < 0))
last_tick = world.timeofday
if(!src.loc)
on = 0
@@ -69,5 +73,3 @@
icon_state = "intercom-p"
else
icon_state = "intercom"
sleep(30)
@@ -1,5 +1,6 @@
/obj/item/weapon/melee/energy
var/active = 0
flags = FPRINT | TABLEPASS | NOBLOODY
suicide_act(mob/user)
viewers(user) << pick("\red <b>[user] is slitting \his stomach open with the [src.name]! It looks like \he's trying to commit seppuku.</b>", \
@@ -15,7 +16,7 @@
throw_speed = 1
throw_range = 5
w_class = 3.0
flags = FPRINT | CONDUCT | NOSHIELD | TABLEPASS
flags = FPRINT | CONDUCT | NOSHIELD | TABLEPASS | NOBLOODY
origin_tech = "combat=3"
attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut")
@@ -33,7 +34,7 @@
throw_speed = 1
throw_range = 5
w_class = 2.0
flags = FPRINT | TABLEPASS | NOSHIELD
flags = FPRINT | TABLEPASS | NOSHIELD | NOBLOODY
origin_tech = "magnets=3;syndicate=4"
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
var/hacked = 0
@@ -52,6 +53,6 @@
throw_speed = 1
throw_range = 1
w_class = 4.0//So you can't hide it in your pocket or some such.
flags = FPRINT | TABLEPASS | NOSHIELD
flags = FPRINT | TABLEPASS | NOSHIELD | NOBLOODY
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
var/datum/effect/effect/system/spark_spread/spark_system
+2 -2
View File
@@ -924,7 +924,7 @@
user.SetLuminosity(round(user.luminosity + (potency/10),1))
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/dropped(mob/user)
user.SetLuminosity(round(user.luminosity + (potency/10),1))
user.SetLuminosity(round(user.luminosity - (potency/10),1))
SetLuminosity(round(potency/10,1))
//This object is just a transition object. All it does is make dosh and delete itself. -Cheridan
@@ -968,4 +968,4 @@
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 20), 1))
reagents.add_reagent("singulo", 1+round((potency / 5), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
bitesize = 1+round(reagents.total_volume / 2, 1)
@@ -53,4 +53,124 @@
else if(module_state_3 == O)
return 1
else
return 0
return 0
//Helper procs for cyborg modules on the UI.
//These are hackish but they help clean up code elsewhere.
//module_selected(module) - Checks whether the module slot specified by "module" is currently selected.
/mob/living/silicon/robot/proc/module_selected(var/module) //Module is 1-3
return module == get_selected_module()
//module_active(module) - Checks whether there is a module active in the slot specified by "module".
/mob/living/silicon/robot/proc/module_active(var/module) //Module is 1-3
if(module < 1 || module > 3) return 0
switch(module)
if(1)
if(module_state_1)
return 1
if(2)
if(module_state_2)
return 1
if(3)
if(module_state_3)
return 1
return 0
//get_selected_module() - Returns the slot number of the currently selected module. Returns 0 if no modules are selected.
/mob/living/silicon/robot/proc/get_selected_module()
if(module_state_1 && module_active == module_state_1)
return 1
else if(module_state_2 && module_active == module_state_2)
return 2
else if(module_state_3 && module_active == module_state_3)
return 3
return 0
//select_module(module) - Selects the module slot specified by "module"
/mob/living/silicon/robot/proc/select_module(var/module) //Module is 1-3
if(module < 1 || module > 3) return
if(!module_active(module)) return
switch(module)
if(1)
if(module_active != module_state_1)
inv1.icon_state = "inv1 +a"
inv2.icon_state = "inv2"
inv3.icon_state = "inv3"
module_active = module_state_1
return
if(2)
if(module_active != module_state_2)
inv1.icon_state = "inv1"
inv2.icon_state = "inv2 +a"
inv3.icon_state = "inv3"
module_active = module_state_2
return
if(3)
if(module_active != module_state_3)
inv1.icon_state = "inv1"
inv2.icon_state = "inv2"
inv3.icon_state = "inv3 +a"
module_active = module_state_3
return
return
//deselect_module(module) - Deselects the module slot specified by "module"
/mob/living/silicon/robot/proc/deselect_module(var/module) //Module is 1-3
if(module < 1 || module > 3) return
switch(module)
if(1)
if(module_active == module_state_1)
inv1.icon_state = "inv1"
module_active = null
return
if(2)
if(module_active == module_state_2)
inv2.icon_state = "inv2"
module_active = null
return
if(3)
if(module_active == module_state_3)
inv3.icon_state = "inv3"
module_active = null
return
return
//toggle_module(module) - Toggles the selection of the module slot specified by "module".
/mob/living/silicon/robot/proc/toggle_module(var/module) //Module is 1-3
if(module < 1 || module > 3) return
if(module_selected(module))
deselect_module(module)
else
if(module_active(module))
select_module(module)
else
deselect_module(get_selected_module()) //If we can't do select anything, at least deselect the current module.
return
//cycle_modules() - Cycles through the list of selected modules.
/mob/living/silicon/robot/proc/cycle_modules()
var/slot_start = get_selected_module()
if(slot_start) deselect_module(slot_start) //Only deselect if we have a selected slot.
var/slot_num
if(slot_start == 0)
slot_num = 1
slot_start = 2
else
slot_num = slot_start + 1
while(slot_start != slot_num) //If we wrap around without finding any free slots, just give up.
if(module_active(slot_num))
select_module(slot_num)
return
slot_num++
if(slot_num > 3) slot_num = 1 //Wrap around.
return
+2 -66
View File
@@ -54,73 +54,9 @@
set hidden = 1
if(istype(mob, /mob/living/carbon))
mob:swap_hand()
if(istype(mob,/mob/living/silicon/robot))//Oh nested logic loops, is there anything you can't do? -Sieve
if(istype(mob,/mob/living/silicon/robot))
var/mob/living/silicon/robot/R = mob
if(!R.module_active)
if(!R.module_state_1)
if(!R.module_state_2)
if(!R.module_state_3)
return
else
R:inv1.icon_state = "inv1"
R:inv2.icon_state = "inv2"
R:inv3.icon_state = "inv3 +a"
R:module_active = R:module_state_3
else
R:inv1.icon_state = "inv1"
R:inv2.icon_state = "inv2 +a"
R:inv3.icon_state = "inv3"
R:module_active = R:module_state_2
else
R:inv1.icon_state = "inv1 +a"
R:inv2.icon_state = "inv2"
R:inv3.icon_state = "inv3"
R:module_active = R:module_state_1
else
if(R.module_active == R.module_state_1)
if(!R.module_state_2)
if(!R.module_state_3)
return
else
R:inv1.icon_state = "inv1"
R:inv2.icon_state = "inv2"
R:inv3.icon_state = "inv3 +a"
R:module_active = R:module_state_3
else
R:inv1.icon_state = "inv1"
R:inv2.icon_state = "inv2 +a"
R:inv3.icon_state = "inv3"
R:module_active = R:module_state_2
else if(R.module_active == R.module_state_2)
if(!R.module_state_3)
if(!R.module_state_1)
return
else
R:inv1.icon_state = "inv1 +a"
R:inv2.icon_state = "inv2"
R:inv3.icon_state = "inv3"
R:module_active = R:module_state_1
else
R:inv1.icon_state = "inv1"
R:inv2.icon_state = "inv2"
R:inv3.icon_state = "inv3 +a"
R:module_active = R:module_state_3
else if(R.module_active == R.module_state_3)
if(!R.module_state_1)
if(!R.module_state_2)
return
else
R:inv1.icon_state = "inv1"
R:inv2.icon_state = "inv2 +a"
R:inv3.icon_state = "inv3"
R:module_active = R:module_state_2
else
R:inv1.icon_state = "inv1 +a"
R:inv2.icon_state = "inv2"
R:inv3.icon_state = "inv3"
R:module_active = R:module_state_1
else
return
R.cycle_modules()
return
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB