Combat cyborg module shields and mobility.

This commit is contained in:
Zuhayr
2013-07-02 01:39:22 -07:00
parent e3696a13e9
commit cf4248b9c9
8 changed files with 67 additions and 14 deletions

View File

@@ -5,8 +5,6 @@
/mob/living/silicon/robot/get_active_hand()
return module_active
/*-------TODOOOOOOOOOO--------*/
/mob/living/silicon/robot/proc/uneq_active()
if(isnull(module_active))
@@ -38,6 +36,7 @@
module_active = null
module_state_3 = null
inv3.icon_state = "inv3"
updateicon()
/mob/living/silicon/robot/proc/uneq_all()
module_active = null
@@ -66,7 +65,7 @@
contents -= module_state_3
module_state_3 = null
inv3.icon_state = "inv3"
updateicon()
/mob/living/silicon/robot/proc/activated(obj/item/O)
if(module_state_1 == O)
@@ -76,4 +75,5 @@
else if(module_state_3 == O)
return 1
else
return 0
return 0
updateicon()

View File

@@ -5,7 +5,6 @@
if (src.monkeyizing)
return
src.blinded = null
//Status updates, death etc.
@@ -21,9 +20,6 @@
process_locks()
update_canmove()
/mob/living/silicon/robot/proc/clamp_values()
// SetStunned(min(stunned, 30))
@@ -286,7 +282,7 @@
src.module_state_2:screen_loc = ui_inv2
if(src.module_state_3)
src.module_state_3:screen_loc = ui_inv3
updateicon()
/mob/living/silicon/robot/proc/process_killswitch()
if(killswitch)

View File

@@ -9,6 +9,7 @@
var/sight_mode = 0
var/custom_name = ""
var/base_icon
//Hud stuff
@@ -241,6 +242,7 @@
choose_icon(6,module_sprites)
radio.config(channels)
base_icon = icon_state
/mob/living/silicon/robot/proc/updatename(var/prefix as text)
@@ -985,7 +987,16 @@
overlays += "ov-openpanel +c"
else
overlays += "ov-openpanel -c"
return
if(module_active && istype(module_active,/obj/item/borg/combat/shield))
overlays += "[icon_state]-shield"
if(base_icon)
if(module_active && istype(module_active,/obj/item/borg/combat/mobility))
icon_state = "[base_icon]-roll"
else
icon_state = base_icon
return
//Call when target overlay should be added/removed
/mob/living/silicon/robot/update_targeted()
@@ -1227,4 +1238,4 @@
choose_icon(triesleft, module_sprites)
else
triesleft = 0
return
return

View File

@@ -12,7 +12,6 @@
if(C.installed == 1) amount += C.electronics_damage
return amount
/mob/living/silicon/robot/adjustBruteLoss(var/amount)
if(amount > 0)
take_overall_damage(amount, 0)
@@ -70,9 +69,27 @@
parts -= picked
/mob/living/silicon/robot/take_overall_damage(var/brute, var/burn, var/sharp = 0, var/used_weapon = null)
/mob/living/silicon/robot/take_overall_damage(var/brute = 0, var/burn = 0, var/sharp = 0, var/used_weapon = null)
if(status_flags & GODMODE) return //godmode
var/list/datum/robot_component/parts = get_damageable_components()
//Combat shielding absorbs a percentage of damage directly into the cell.
if(module_active && istype(module_active,/obj/item/borg/combat/shield))
var/obj/item/borg/combat/shield/shield = module_active
//Shields absorb a certain percentage of damage based on their power setting.
var/absorb_brute = brute*shield.shield_level
var/absorb_burn = burn*shield.shield_level
var/cost = (absorb_brute+absorb_burn)*100
cell.charge -= cost
if(cell.charge <= 0)
cell.charge = 0
src << "\red Your shield has overloaded!"
else
brute -= absorb_brute
burn -= absorb_burn
src << "\red Your shield absorbs some of the impact!"
while(parts.len && (brute>0 || burn>0) )
var/datum/robot_component/picked = pick(parts)

View File

@@ -120,3 +120,25 @@
add_fingerprint(user)
return
//Personal shielding for the combat module.
/obj/item/borg/combat/shield
name = "personal shielding"
desc = "A powerful experimental module that turns aside or absorbs incoming attacks at the cost of charge."
icon = 'icons/obj/decals.dmi'
icon_state = "shock"
var/shield_level = 0.5 //Percentage of damage absorbed by the shield.
/obj/item/borg/combat/shield/verb/set_shield_level()
set name = "Set shield level"
set category = "Object"
set src in range(0)
var/N = input("How much damage should the shield absorb?") in list("5","10","25","50","75","100")
if (N)
shield_level = text2num(N)/100
/obj/item/borg/combat/mobility
name = "mobility module"
desc = "By retracting limbs and tucking in its head, a combat android can roll at high speeds."
icon = 'icons/obj/decals.dmi'
icon_state = "shock"

View File

@@ -226,9 +226,10 @@
New()
src.modules += new /obj/item/borg/sight/thermal(src)
src.modules += new /obj/item/weapon/melee/energy/sword(src)
src.modules += new /obj/item/weapon/gun/energy/lasercannon/cyborg(src)
src.modules += new /obj/item/weapon/pickaxe/plasmacutter(src)
src.modules += new /obj/item/borg/combat/shield(src)
src.modules += new /obj/item/borg/combat/mobility(src)
src.modules += new /obj/item/weapon/wrench(src) //Is a combat android really going to be stopped by a chair?
src.emag = new /obj/item/weapon/gun/energy/pulse_rifle/cyborg(src)
return

View File

@@ -12,4 +12,10 @@
tally = speed
if(module_active && istype(module_active,/obj/item/borg/combat/mobility))
tally-=3
return tally+config.robot_delay
/mob/living/silicon/robot/Move()
..()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 135 KiB