Merge pull request #6131 from Crazylemon64/robot_module_actions

Robot module actions
This commit is contained in:
Fox McCloud
2017-01-11 08:50:50 -05:00
committed by GitHub
9 changed files with 71 additions and 78 deletions
@@ -14,10 +14,6 @@
return 0
O.mouse_opacity = 2
if(istype(O,/obj/item/borg/sight))
var/obj/item/borg/sight/S = O
sight_mode &= ~S.sight_mode
update_sight()
if(client)
client.screen -= O
@@ -53,7 +49,6 @@
if((cell.charge * 100 / cell.maxcharge) < B.powerneeded)
to_chat(src, "Not enough power to activate [B.name]!")
return
var/activated_thingy = null
if(!module_state_1)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_1 = O
@@ -61,7 +56,6 @@
O.plane = HUD_PLANE
O.screen_loc = inv1.screen_loc
contents += O
activated_thingy = O
else if(!module_state_2)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_2 = O
@@ -69,7 +63,6 @@
O.plane = HUD_PLANE
O.screen_loc = inv2.screen_loc
contents += O
activated_thingy = O
else if(!module_state_3)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_3 = O
@@ -77,13 +70,8 @@
O.plane = HUD_PLANE
O.screen_loc = inv3.screen_loc
contents += O
activated_thingy = O
else
to_chat(src, "You need to disable a module first!")
if(istype(activated_thingy,/obj/item/borg/sight))
var/obj/item/borg/sight/such_a_thing = activated_thingy
sight_mode |= such_a_thing.sight_mode
update_sight()
update_icons()
/mob/living/silicon/robot/proc/uneq_active()
@@ -86,6 +86,7 @@ var/list/robot_verbs_default = list(
var/datum/effect/system/ion_trail_follow/ion_trail // Ionpulse effect.
var/datum/action/item_action/toggle_research_scanner/scanner = null
var/list/module_actions = list()
/mob/living/silicon/robot/New(loc,var/syndie = 0,var/unfinished = 0, var/alien = 0)
spark_system = new /datum/effect/system/spark_spread()
@@ -371,7 +372,7 @@ var/list/robot_verbs_default = list(
//languages
module.add_languages(src)
//subsystems
module.add_subsystems(src)
module.add_subsystems_and_actions(src)
//Custom_sprite check and entry
if(custom_sprite == 1)
@@ -1424,7 +1425,7 @@ var/list/robot_verbs_default = list(
//languages
module.add_languages(src)
//subsystems
module.add_subsystems(src)
module.add_subsystems_and_actions(src)
status_flags &= ~CANPUSH
@@ -1443,7 +1444,7 @@ var/list/robot_verbs_default = list(
//languages
module.add_languages(src)
//subsystems
module.add_subsystems(src)
module.add_subsystems_and_actions(src)
status_flags &= ~CANPUSH
@@ -0,0 +1,37 @@
/datum/action/innate/robot_sight
var/sight_mode = null
icon_icon = 'icons/obj/decals.dmi'
button_icon_state = "securearea"
/datum/action/innate/robot_sight/Activate()
var/mob/living/silicon/robot/R = owner
R.sight_mode |= sight_mode
R.update_sight()
active = 1
/datum/action/innate/robot_sight/Deactivate()
var/mob/living/silicon/robot/R = owner
R.sight_mode &= ~sight_mode
R.update_sight()
active = 0
/datum/action/innate/robot_sight/xray
name = "X-ray Vision"
sight_mode = BORGXRAY
/datum/action/innate/robot_sight/thermal
name = "Thermal Vision"
sight_mode = BORGTHERM
icon_icon = 'icons/obj/clothing/glasses.dmi'
button_icon_state = "thermal"
// ayylmao
/datum/action/innate/robot_sight/thermal/alien
icon_icon = 'icons/mob/alien.dmi'
button_icon_state = "borg-extra-vision"
/datum/action/innate/robot_sight/meson
name = "Meson Vision"
sight_mode = BORGMESON
icon_icon = 'icons/obj/clothing/glasses.dmi'
button_icon_state = "meson"
@@ -9,6 +9,7 @@
var/list/modules = list()
var/obj/item/emag = null
var/list/subsystems = list()
var/list/module_actions = list()
var/module_type = "NoMod" // For icon usage
@@ -92,11 +93,19 @@
R.add_language("Orluum", 0)
R.add_language("Clownish",0)
/obj/item/weapon/robot_module/proc/add_subsystems(mob/living/silicon/robot/R)
/obj/item/weapon/robot_module/proc/add_subsystems_and_actions(mob/living/silicon/robot/R)
R.verbs |= subsystems
for(var/A in module_actions)
var/datum/action/act = new A()
act.Grant(R)
R.module_actions += act
/obj/item/weapon/robot_module/proc/remove_subsystems(mob/living/silicon/robot/R)
/obj/item/weapon/robot_module/proc/remove_subsystems_and_actions(mob/living/silicon/robot/R)
R.verbs -= subsystems
for(var/datum/action/A in R.module_actions)
A.Remove(R)
qdel(A)
R.module_actions.Cut()
/obj/item/weapon/robot_module/standard
name = "standard robot module"
@@ -166,6 +175,9 @@
name = "engineering robot module"
module_type = "Engineer"
subsystems = list(/mob/living/silicon/proc/subsystem_power_monitor)
module_actions = list(
/datum/action/innate/robot_sight/meson,
)
stacktypes = list(
/obj/item/stack/sheet/metal/cyborg = 50,
@@ -178,7 +190,6 @@
/obj/item/weapon/robot_module/engineering/New()
..()
modules += new /obj/item/borg/sight/meson(src)
modules += new /obj/item/weapon/rcd/borg(src)
modules += new /obj/item/weapon/extinguisher(src)
modules += new /obj/item/weapon/weldingtool/largetank/cyborg(src)
@@ -297,10 +308,12 @@
/obj/item/weapon/robot_module/miner
name = "miner robot module"
module_type = "Miner"
module_actions = list(
/datum/action/innate/robot_sight/meson,
)
/obj/item/weapon/robot_module/miner/New()
..()
modules += new /obj/item/borg/sight/meson(src)
modules += new /obj/item/weapon/storage/bag/ore/cyborg(src)
modules += new /obj/item/weapon/pickaxe/drill/cyborg(src)
modules += new /obj/item/weapon/shovel(src)
@@ -317,10 +330,12 @@
/obj/item/weapon/robot_module/deathsquad
name = "NT advanced combat module"
module_type = "Malf"
module_actions = list(
/datum/action/innate/robot_sight/thermal,
)
/obj/item/weapon/robot_module/deathsquad/New()
..()
modules += new /obj/item/borg/sight/thermal(src)
modules += new /obj/item/weapon/melee/energy/sword/cyborg(src)
modules += new /obj/item/weapon/gun/energy/pulse/cyborg(src)
modules += new /obj/item/weapon/crowbar(src)
@@ -385,11 +400,13 @@
/obj/item/weapon/robot_module/combat
name = "combat robot module"
module_type = "Malf"
module_actions = list(
/datum/action/innate/robot_sight/thermal,
)
/obj/item/weapon/robot_module/combat/New()
..()
modules += new /obj/item/weapon/restraints/handcuffs/cable/zipties/cyborg(src)
modules += new /obj/item/borg/sight/thermal(src)
modules += new /obj/item/weapon/gun/energy/gun/cyborg(src)
modules += new /obj/item/weapon/pickaxe/drill/jackhammer(src)
modules += new /obj/item/borg/combat/shield(src)
@@ -418,11 +435,13 @@
/obj/item/weapon/robot_module/alien/hunter
name = "alien hunter module"
module_type = "Standard"
module_actions = list(
/datum/action/innate/robot_sight/thermal/alien,
)
/obj/item/weapon/robot_module/alien/hunter/New()
modules += new /obj/item/weapon/melee/energy/alien/claws(src)
modules += new /obj/item/device/flash/cyborg/alien(src)
modules += new /obj/item/borg/sight/thermal/alien(src)
var/obj/item/weapon/reagent_containers/spray/alien/stun/S = new /obj/item/weapon/reagent_containers/spray/alien/stun(src)
S.reagents.add_reagent("ether",250) //nerfed to sleeptoxin to make it less instant drop.
modules += S