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
+1
View File
@@ -705,6 +705,7 @@
for(var/obj/item/O in I) // the things inside the tools, if anything; mainly for janiborg trash bags
O.loc = R
qdel(I)
R.module.remove_subsystems_and_actions(R)
qdel(R.module)
return ..()
@@ -34,51 +34,3 @@
name = "Overdrive"
icon = 'icons/obj/decals.dmi'
icon_state = "shock"
/**********************************************************************
HUD/SIGHT things
***********************************************************************/
/obj/item/borg/sight
icon = 'icons/obj/decals.dmi'
icon_state = "securearea"
var/sight_mode = null
/obj/item/borg/sight/xray
name = "X-ray Vision"
sight_mode = BORGXRAY
/obj/item/borg/sight/thermal
name = "Thermal Vision"
sight_mode = BORGTHERM
icon_state = "thermal"
icon = 'icons/obj/clothing/glasses.dmi'
/obj/item/borg/sight/meson
name = "Meson Vision"
sight_mode = BORGMESON
icon_state = "meson"
icon = 'icons/obj/clothing/glasses.dmi'
/obj/item/borg/sight/hud
name = "Hud"
var/obj/item/clothing/glasses/hud/hud = null
/obj/item/borg/sight/hud/med
name = "medical hud"
icon_state = "healthhud"
icon = 'icons/obj/clothing/glasses.dmi'
/obj/item/borg/sight/hud/med/New()
..()
hud = new /obj/item/clothing/glasses/hud/health(src)
return
/obj/item/borg/sight/hud/sec
name = "security hud"
icon_state = "securityhud"
icon = 'icons/obj/clothing/glasses.dmi'
/obj/item/borg/sight/hud/sec/New()
..()
hud = new /obj/item/clothing/glasses/hud/security(src)
return
@@ -35,6 +35,7 @@
R.uneq_all()
R.hands.icon_state = "nomod"
R.icon_state = "robot"
R.module.remove_subsystems_and_actions(R)
qdel(R.module)
R.module = null
@@ -328,4 +329,4 @@
to_chat(cyborg, "<span class='notice'>Self-repair is active in <span class='boldnotice'>[msgmode]</span> mode.</span>")
msg_cooldown = world.time
else
deactivate()
deactivate()
@@ -64,10 +64,3 @@
desc = "Useful for taking pictures, making friends and flash-frying chips."
icon = 'icons/mob/alien.dmi'
icon_state = "borg-flash"
//heat vision
/obj/item/borg/sight/thermal/alien
name = "thermal module"
icon = 'icons/mob/alien.dmi'
icon_state = "borg-extra-vision"
@@ -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
+1
View File
@@ -1610,6 +1610,7 @@
#include "code\modules\mob\living\silicon\robot\robot_damage.dm"
#include "code\modules\mob\living\silicon\robot\robot_items.dm"
#include "code\modules\mob\living\silicon\robot\robot_modules.dm"
#include "code\modules\mob\living\silicon\robot\robot_module_actions.dm"
#include "code\modules\mob\living\silicon\robot\robot_movement.dm"
#include "code\modules\mob\living\silicon\robot\update_status.dm"
#include "code\modules\mob\living\silicon\robot\drone\drone.dm"