@@ -0,0 +1,818 @@
|
||||
/**********************************************************************
|
||||
Cyborg Spec Items
|
||||
***********************************************************************/
|
||||
/obj/item/borg
|
||||
icon = 'icons/mob/robot_items.dmi'
|
||||
|
||||
|
||||
/obj/item/borg/stun
|
||||
name = "electrically-charged arm"
|
||||
icon_state = "elecarm"
|
||||
var/charge_cost = 30
|
||||
|
||||
/obj/item/borg/stun/attack(mob/living/M, mob/living/user)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.check_shields(src, 0, "[M]'s [name]", MELEE_ATTACK))
|
||||
playsound(M, 'sound/weapons/genhit.ogg', 50, 1)
|
||||
return FALSE
|
||||
if(iscyborg(user))
|
||||
var/mob/living/silicon/robot/R = user
|
||||
if(!R.cell.use(charge_cost))
|
||||
return
|
||||
|
||||
user.do_attack_animation(M)
|
||||
M.Knockdown(100)
|
||||
M.apply_effect(EFFECT_STUTTER, 5)
|
||||
|
||||
M.visible_message("<span class='danger'>[user] has prodded [M] with [src]!</span>", \
|
||||
"<span class='userdanger'>[user] has prodded you with [src]!</span>")
|
||||
|
||||
playsound(loc, 'sound/weapons/egloves.ogg', 50, 1, -1)
|
||||
|
||||
log_combat(user, M, "stunned", src, "(INTENT: [uppertext(user.a_intent)])")
|
||||
|
||||
/obj/item/borg/cyborghug
|
||||
name = "hugging module"
|
||||
icon_state = "hugmodule"
|
||||
desc = "For when a someone really needs a hug."
|
||||
var/mode = 0 //0 = Hugs 1 = "Hug" 2 = Shock 3 = CRUSH
|
||||
var/ccooldown = 0
|
||||
var/scooldown = 0
|
||||
var/shockallowed = FALSE//Can it be a stunarm when emagged. Only PK borgs get this by default.
|
||||
var/boop = FALSE
|
||||
|
||||
/obj/item/borg/cyborghug/attack_self(mob/living/user)
|
||||
if(iscyborg(user))
|
||||
var/mob/living/silicon/robot/P = user
|
||||
if(P.emagged&&shockallowed == 1)
|
||||
if(mode < 3)
|
||||
mode++
|
||||
else
|
||||
mode = 0
|
||||
else if(mode < 1)
|
||||
mode++
|
||||
else
|
||||
mode = 0
|
||||
switch(mode)
|
||||
if(0)
|
||||
to_chat(user, "Power reset. Hugs!")
|
||||
if(1)
|
||||
to_chat(user, "Power increased!")
|
||||
if(2)
|
||||
to_chat(user, "BZZT. Electrifying arms...")
|
||||
if(3)
|
||||
to_chat(user, "ERROR: ARM ACTUATORS OVERLOADED.")
|
||||
|
||||
/obj/item/borg/cyborghug/attack(mob/living/M, mob/living/silicon/robot/user)
|
||||
if(M == user)
|
||||
return
|
||||
switch(mode)
|
||||
if(0)
|
||||
if(M.health >= 0)
|
||||
if(user.zone_selected == BODY_ZONE_HEAD)
|
||||
user.visible_message("<span class='notice'>[user] playfully boops [M] on the head!</span>", \
|
||||
"<span class='notice'>You playfully boop [M] on the head!</span>")
|
||||
user.do_attack_animation(M, ATTACK_EFFECT_BOOP)
|
||||
playsound(loc, 'sound/weapons/tap.ogg', 50, 1, -1)
|
||||
else if(ishuman(M))
|
||||
if(M.lying)
|
||||
user.visible_message("<span class='notice'>[user] shakes [M] trying to get [M.p_them()] up!</span>", \
|
||||
"<span class='notice'>You shake [M] trying to get [M.p_them()] up!</span>")
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] hugs [M] to make [M.p_them()] feel better!</span>", \
|
||||
"<span class='notice'>You hug [M] to make [M.p_them()] feel better!</span>")
|
||||
if(M.resting && !M.recoveringstam)
|
||||
M.resting = FALSE
|
||||
M.update_canmove()
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] pets [M]!</span>", \
|
||||
"<span class='notice'>You pet [M]!</span>")
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
if(1)
|
||||
if(M.health >= 0)
|
||||
if(ishuman(M))
|
||||
if(M.lying)
|
||||
user.visible_message("<span class='notice'>[user] shakes [M] trying to get [M.p_them()] up!</span>", \
|
||||
"<span class='notice'>You shake [M] trying to get [M.p_them()] up!</span>")
|
||||
else if(user.zone_selected == BODY_ZONE_HEAD)
|
||||
user.visible_message("<span class='warning'>[user] bops [M] on the head!</span>", \
|
||||
"<span class='warning'>You bop [M] on the head!</span>")
|
||||
user.do_attack_animation(M, ATTACK_EFFECT_PUNCH)
|
||||
else
|
||||
user.visible_message("<span class='warning'>[user] hugs [M] in a firm bear-hug! [M] looks uncomfortable...</span>", \
|
||||
"<span class='warning'>You hug [M] firmly to make [M.p_them()] feel better! [M] looks uncomfortable...</span>")
|
||||
if(M.resting && !M.recoveringstam)
|
||||
M.resting = FALSE
|
||||
M.update_canmove()
|
||||
else
|
||||
user.visible_message("<span class='warning'>[user] bops [M] on the head!</span>", \
|
||||
"<span class='warning'>You bop [M] on the head!</span>")
|
||||
playsound(loc, 'sound/weapons/tap.ogg', 50, 1, -1)
|
||||
if(2)
|
||||
if(scooldown < world.time)
|
||||
if(M.health >= 0)
|
||||
if(ishuman(M)||ismonkey(M))
|
||||
M.electrocute_act(5, "[user]", safety = 1)
|
||||
user.visible_message("<span class='userdanger'>[user] electrocutes [M] with [user.p_their()] touch!</span>", \
|
||||
"<span class='danger'>You electrocute [M] with your touch!</span>")
|
||||
M.update_canmove()
|
||||
else
|
||||
if(!iscyborg(M))
|
||||
M.adjustFireLoss(10)
|
||||
user.visible_message("<span class='userdanger'>[user] shocks [M]!</span>", \
|
||||
"<span class='danger'>You shock [M]!</span>")
|
||||
else
|
||||
user.visible_message("<span class='userdanger'>[user] shocks [M]. It does not seem to have an effect</span>", \
|
||||
"<span class='danger'>You shock [M] to no effect.</span>")
|
||||
playsound(loc, 'sound/effects/sparks2.ogg', 50, 1, -1)
|
||||
user.cell.charge -= 500
|
||||
scooldown = world.time + 20
|
||||
if(3)
|
||||
if(ccooldown < world.time)
|
||||
if(M.health >= 0)
|
||||
if(ishuman(M))
|
||||
user.visible_message("<span class='userdanger'>[user] crushes [M] in [user.p_their()] grip!</span>", \
|
||||
"<span class='danger'>You crush [M] in your grip!</span>")
|
||||
else
|
||||
user.visible_message("<span class='userdanger'>[user] crushes [M]!</span>", \
|
||||
"<span class='danger'>You crush [M]!</span>")
|
||||
playsound(loc, 'sound/weapons/smash.ogg', 50, 1, -1)
|
||||
M.adjustBruteLoss(15)
|
||||
user.cell.charge -= 300
|
||||
ccooldown = world.time + 10
|
||||
|
||||
/obj/item/borg/cyborghug/peacekeeper
|
||||
shockallowed = TRUE
|
||||
|
||||
/obj/item/borg/cyborghug/medical
|
||||
boop = TRUE
|
||||
|
||||
/obj/item/borg/charger
|
||||
name = "power connector"
|
||||
icon_state = "charger_draw"
|
||||
item_flags = NOBLUDGEON
|
||||
var/mode = "draw"
|
||||
var/static/list/charge_machines = typecacheof(list(/obj/machinery/cell_charger, /obj/machinery/recharger, /obj/machinery/recharge_station, /obj/machinery/mech_bay_recharge_port))
|
||||
var/static/list/charge_items = typecacheof(list(/obj/item/stock_parts/cell, /obj/item/gun/energy))
|
||||
|
||||
/obj/item/borg/charger/Initialize()
|
||||
. = ..()
|
||||
|
||||
/obj/item/borg/charger/update_icon()
|
||||
..()
|
||||
icon_state = "charger_[mode]"
|
||||
|
||||
/obj/item/borg/charger/attack_self(mob/user)
|
||||
if(mode == "draw")
|
||||
mode = "charge"
|
||||
else
|
||||
mode = "draw"
|
||||
to_chat(user, "<span class='notice'>You toggle [src] to \"[mode]\" mode.</span>")
|
||||
update_icon()
|
||||
|
||||
/obj/item/borg/charger/afterattack(obj/item/target, mob/living/silicon/robot/user, proximity_flag)
|
||||
. = ..()
|
||||
if(!proximity_flag || !iscyborg(user))
|
||||
return
|
||||
if(mode == "draw")
|
||||
if(is_type_in_list(target, charge_machines))
|
||||
var/obj/machinery/M = target
|
||||
if((M.stat & (NOPOWER|BROKEN)) || !M.anchored)
|
||||
to_chat(user, "<span class='warning'>[M] is unpowered!</span>")
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>You connect to [M]'s power line...</span>")
|
||||
while(do_after(user, 15, target = M, progress = 0))
|
||||
if(!user || !user.cell || mode != "draw")
|
||||
return
|
||||
|
||||
if((M.stat & (NOPOWER|BROKEN)) || !M.anchored)
|
||||
break
|
||||
|
||||
if(!user.cell.give(150))
|
||||
break
|
||||
|
||||
M.use_power(200)
|
||||
|
||||
to_chat(user, "<span class='notice'>You stop charging yourself.</span>")
|
||||
|
||||
else if(is_type_in_list(target, charge_items))
|
||||
var/obj/item/stock_parts/cell/cell = target
|
||||
if(!istype(cell))
|
||||
cell = locate(/obj/item/stock_parts/cell) in target
|
||||
if(!cell)
|
||||
to_chat(user, "<span class='warning'>[target] has no power cell!</span>")
|
||||
return
|
||||
|
||||
if(istype(target, /obj/item/gun/energy))
|
||||
var/obj/item/gun/energy/E = target
|
||||
if(!E.can_charge)
|
||||
to_chat(user, "<span class='warning'>[target] has no power port!</span>")
|
||||
return
|
||||
|
||||
if(!cell.charge)
|
||||
to_chat(user, "<span class='warning'>[target] has no power!</span>")
|
||||
|
||||
|
||||
to_chat(user, "<span class='notice'>You connect to [target]'s power port...</span>")
|
||||
|
||||
while(do_after(user, 15, target = target, progress = 0))
|
||||
if(!user || !user.cell || mode != "draw")
|
||||
return
|
||||
|
||||
if(!cell || !target)
|
||||
return
|
||||
|
||||
if(cell != target && cell.loc != target)
|
||||
return
|
||||
|
||||
var/draw = min(cell.charge, cell.chargerate*0.5, user.cell.maxcharge-user.cell.charge)
|
||||
if(!cell.use(draw))
|
||||
break
|
||||
if(!user.cell.give(draw))
|
||||
break
|
||||
target.update_icon()
|
||||
|
||||
to_chat(user, "<span class='notice'>You stop charging yourself.</span>")
|
||||
|
||||
else if(is_type_in_list(target, charge_items))
|
||||
var/obj/item/stock_parts/cell/cell = target
|
||||
if(!istype(cell))
|
||||
cell = locate(/obj/item/stock_parts/cell) in target
|
||||
if(!cell)
|
||||
to_chat(user, "<span class='warning'>[target] has no power cell!</span>")
|
||||
return
|
||||
|
||||
if(istype(target, /obj/item/gun/energy))
|
||||
var/obj/item/gun/energy/E = target
|
||||
if(!E.can_charge)
|
||||
to_chat(user, "<span class='warning'>[target] has no power port!</span>")
|
||||
return
|
||||
|
||||
if(cell.charge >= cell.maxcharge)
|
||||
to_chat(user, "<span class='warning'>[target] is already charged!</span>")
|
||||
|
||||
to_chat(user, "<span class='notice'>You connect to [target]'s power port...</span>")
|
||||
|
||||
while(do_after(user, 15, target = target, progress = 0))
|
||||
if(!user || !user.cell || mode != "charge")
|
||||
return
|
||||
|
||||
if(!cell || !target)
|
||||
return
|
||||
|
||||
if(cell != target && cell.loc != target)
|
||||
return
|
||||
|
||||
var/draw = min(user.cell.charge, cell.chargerate*0.5, cell.maxcharge-cell.charge)
|
||||
if(!user.cell.use(draw))
|
||||
break
|
||||
if(!cell.give(draw))
|
||||
break
|
||||
target.update_icon()
|
||||
|
||||
to_chat(user, "<span class='notice'>You stop charging [target].</span>")
|
||||
|
||||
/obj/item/harmalarm
|
||||
name = "\improper Sonic Harm Prevention Tool"
|
||||
desc = "Releases a harmless blast that confuses most organics. For when the harm is JUST TOO MUCH."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "megaphone"
|
||||
var/cooldown = 0
|
||||
|
||||
/obj/item/harmalarm/emag_act(mob/user)
|
||||
. = ..()
|
||||
obj_flags ^= EMAGGED
|
||||
if(obj_flags & EMAGGED)
|
||||
to_chat(user, "<font color='red'>You short out the safeties on [src]!</font>")
|
||||
else
|
||||
to_chat(user, "<font color='red'>You reset the safeties on [src]!</font>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/harmalarm/attack_self(mob/user)
|
||||
var/safety = !(obj_flags & EMAGGED)
|
||||
if(cooldown > world.time)
|
||||
to_chat(user, "<font color='red'>The device is still recharging!</font>")
|
||||
return
|
||||
|
||||
if(iscyborg(user))
|
||||
var/mob/living/silicon/robot/R = user
|
||||
if(!R.cell || R.cell.charge < 1200)
|
||||
to_chat(user, "<font color='red'>You don't have enough charge to do this!</font>")
|
||||
return
|
||||
R.cell.charge -= 1000
|
||||
if(R.emagged)
|
||||
safety = FALSE
|
||||
|
||||
if(safety == TRUE)
|
||||
user.visible_message("<font color='red' size='2'>[user] blares out a near-deafening siren from its speakers!</font>", \
|
||||
"<span class='userdanger'>The siren pierces your hearing and confuses you!</span>", \
|
||||
"<span class='danger'>The siren pierces your hearing!</span>")
|
||||
for(var/mob/living/carbon/M in get_hearers_in_view(9, user))
|
||||
if(M.get_ear_protection() == FALSE)
|
||||
M.confused += 6
|
||||
audible_message("<font color='red' size='7'>HUMAN HARM</font>")
|
||||
playsound(get_turf(src), 'sound/effects/harmalarm.ogg', 70, 3)
|
||||
cooldown = world.time + 200
|
||||
log_game("[key_name(user)] used a Cyborg Harm Alarm in [AREACOORD(user)]")
|
||||
if(iscyborg(user))
|
||||
var/mob/living/silicon/robot/R = user
|
||||
to_chat(R.connected_ai, "<br><span class='notice'>NOTICE - Peacekeeping 'HARM ALARM' used by: [user]</span><br>")
|
||||
|
||||
return
|
||||
|
||||
if(safety == FALSE)
|
||||
user.audible_message("<font color='red' size='7'>BZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZT</font>")
|
||||
for(var/mob/living/carbon/C in get_hearers_in_view(9, user))
|
||||
var/bang_effect = C.soundbang_act(2, 0, 0, 5)
|
||||
switch(bang_effect)
|
||||
if(1)
|
||||
C.confused += 5
|
||||
C.stuttering += 10
|
||||
C.Jitter(10)
|
||||
if(2)
|
||||
C.Knockdown(40)
|
||||
C.confused += 10
|
||||
C.stuttering += 15
|
||||
C.Jitter(25)
|
||||
playsound(get_turf(src), 'sound/machines/warning-buzzer.ogg', 130, 3)
|
||||
cooldown = world.time + 600
|
||||
log_game("[key_name(user)] used an emagged Cyborg Harm Alarm in [AREACOORD(user)]")
|
||||
|
||||
#define DISPENSE_LOLLIPOP_MODE 1
|
||||
#define THROW_LOLLIPOP_MODE 2
|
||||
#define THROW_GUMBALL_MODE 3
|
||||
#define DISPENSE_ICECREAM_MODE 4
|
||||
|
||||
/obj/item/borg/lollipop
|
||||
name = "treat fabricator"
|
||||
desc = "Reward humans with various treats. Toggle in-module to switch between dispensing and high velocity ejection modes."
|
||||
icon_state = "lollipop"
|
||||
var/candy = 30
|
||||
var/candymax = 30
|
||||
var/charge_delay = 10
|
||||
var/charging = FALSE
|
||||
var/mode = DISPENSE_LOLLIPOP_MODE
|
||||
|
||||
var/firedelay = 0
|
||||
var/hitspeed = 2
|
||||
var/hitdamage = 0
|
||||
var/emaggedhitdamage = 3
|
||||
|
||||
/obj/item/borg/lollipop/clown
|
||||
emaggedhitdamage = 0
|
||||
|
||||
/obj/item/borg/lollipop/equipped()
|
||||
check_amount()
|
||||
|
||||
/obj/item/borg/lollipop/dropped()
|
||||
check_amount()
|
||||
|
||||
/obj/item/borg/lollipop/proc/check_amount() //Doesn't even use processing ticks.
|
||||
if(charging)
|
||||
return
|
||||
if(candy < candymax)
|
||||
addtimer(CALLBACK(src, .proc/charge_lollipops), charge_delay)
|
||||
charging = TRUE
|
||||
|
||||
/obj/item/borg/lollipop/proc/charge_lollipops()
|
||||
candy++
|
||||
charging = FALSE
|
||||
check_amount()
|
||||
|
||||
/obj/item/borg/lollipop/proc/dispense(atom/A, mob/user)
|
||||
if(candy <= 0)
|
||||
to_chat(user, "<span class='warning'>No treats left in storage!</span>")
|
||||
return FALSE
|
||||
var/turf/T = get_turf(A)
|
||||
if(!T || !istype(T) || !isopenturf(T))
|
||||
return FALSE
|
||||
if(isobj(A))
|
||||
var/obj/O = A
|
||||
if(O.density)
|
||||
return FALSE
|
||||
|
||||
var/obj/item/reagent_containers/food/snacks/L
|
||||
switch(mode)
|
||||
if(DISPENSE_LOLLIPOP_MODE)
|
||||
L = new /obj/item/reagent_containers/food/snacks/lollipop(T)
|
||||
if(DISPENSE_ICECREAM_MODE)
|
||||
L = new /obj/item/reagent_containers/food/snacks/icecream(T)
|
||||
var/obj/item/reagent_containers/food/snacks/icecream/I = L
|
||||
I.add_ice_cream("vanilla")
|
||||
I.desc = "Eat the ice cream."
|
||||
|
||||
var/into_hands = FALSE
|
||||
if(ismob(A))
|
||||
var/mob/M = A
|
||||
into_hands = M.put_in_hands(L)
|
||||
|
||||
candy--
|
||||
check_amount()
|
||||
|
||||
if(into_hands)
|
||||
user.visible_message("<span class='notice'>[user] dispenses a treat into the hands of [A].</span>", "<span class='notice'>You dispense a treat into the hands of [A].</span>", "<span class='italics'>You hear a click.</span>")
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] dispenses a treat.</span>", "<span class='notice'>You dispense a treat.</span>", "<span class='italics'>You hear a click.</span>")
|
||||
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
return TRUE
|
||||
|
||||
/obj/item/borg/lollipop/proc/shootL(atom/target, mob/living/user, params)
|
||||
if(candy <= 0)
|
||||
to_chat(user, "<span class='warning'>Not enough lollipops left!</span>")
|
||||
return FALSE
|
||||
candy--
|
||||
var/obj/item/ammo_casing/caseless/lollipop/A = new /obj/item/ammo_casing/caseless/lollipop(src)
|
||||
A.BB.damage = hitdamage
|
||||
if(hitdamage)
|
||||
A.BB.nodamage = FALSE
|
||||
A.BB.speed = 0.5
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
A.fire_casing(target, user, params, 0, 0, null, 0, src)
|
||||
user.visible_message("<span class='warning'>[user] blasts a flying lollipop at [target]!</span>")
|
||||
check_amount()
|
||||
|
||||
/obj/item/borg/lollipop/proc/shootG(atom/target, mob/living/user, params) //Most certainly a good idea.
|
||||
if(candy <= 0)
|
||||
to_chat(user, "<span class='warning'>Not enough gumballs left!</span>")
|
||||
return FALSE
|
||||
candy--
|
||||
var/obj/item/ammo_casing/caseless/gumball/A = new /obj/item/ammo_casing/caseless/gumball(src)
|
||||
A.BB.damage = hitdamage
|
||||
if(hitdamage)
|
||||
A.BB.nodamage = FALSE
|
||||
A.BB.speed = 0.5
|
||||
A.BB.color = rgb(rand(0, 255), rand(0, 255), rand(0, 255))
|
||||
playsound(src.loc, 'sound/weapons/bulletflyby3.ogg', 50, 1)
|
||||
A.fire_casing(target, user, params, 0, 0, null, 0, src)
|
||||
user.visible_message("<span class='warning'>[user] shoots a high-velocity gumball at [target]!</span>")
|
||||
check_amount()
|
||||
|
||||
/obj/item/borg/lollipop/afterattack(atom/target, mob/living/user, proximity, click_params)
|
||||
. = ..()
|
||||
check_amount()
|
||||
if(iscyborg(user))
|
||||
var/mob/living/silicon/robot/R = user
|
||||
if(!R.cell.use(12))
|
||||
to_chat(user, "<span class='warning'>Not enough power.</span>")
|
||||
return FALSE
|
||||
if(R.emagged)
|
||||
hitdamage = emaggedhitdamage
|
||||
switch(mode)
|
||||
if(DISPENSE_LOLLIPOP_MODE, DISPENSE_ICECREAM_MODE)
|
||||
if(!proximity)
|
||||
return FALSE
|
||||
dispense(target, user)
|
||||
if(THROW_LOLLIPOP_MODE)
|
||||
shootL(target, user, click_params)
|
||||
if(THROW_GUMBALL_MODE)
|
||||
shootG(target, user, click_params)
|
||||
hitdamage = initial(hitdamage)
|
||||
|
||||
/obj/item/borg/lollipop/attack_self(mob/living/user)
|
||||
switch(mode)
|
||||
if(DISPENSE_LOLLIPOP_MODE)
|
||||
mode = THROW_LOLLIPOP_MODE
|
||||
to_chat(user, "<span class='notice'>Module is now throwing lollipops.</span>")
|
||||
if(THROW_LOLLIPOP_MODE)
|
||||
mode = THROW_GUMBALL_MODE
|
||||
to_chat(user, "<span class='notice'>Module is now blasting gumballs.</span>")
|
||||
if(THROW_GUMBALL_MODE)
|
||||
mode = DISPENSE_ICECREAM_MODE
|
||||
to_chat(user, "<span class='notice'>Module is now dispensing ice cream.</span>")
|
||||
if(DISPENSE_ICECREAM_MODE)
|
||||
mode = DISPENSE_LOLLIPOP_MODE
|
||||
to_chat(user, "<span class='notice'>Module is now dispensing lollipops.</span>")
|
||||
..()
|
||||
|
||||
#undef DISPENSE_LOLLIPOP_MODE
|
||||
#undef THROW_LOLLIPOP_MODE
|
||||
#undef THROW_GUMBALL_MODE
|
||||
#undef DISPENSE_ICECREAM_MODE
|
||||
|
||||
/obj/item/ammo_casing/caseless/gumball
|
||||
name = "Gumball"
|
||||
desc = "Why are you seeing this?!"
|
||||
projectile_type = /obj/item/projectile/bullet/reusable/gumball
|
||||
click_cooldown_override = 2
|
||||
|
||||
|
||||
/obj/item/projectile/bullet/reusable/gumball
|
||||
name = "gumball"
|
||||
desc = "Oh noes! A fast-moving gumball!"
|
||||
icon_state = "gumball"
|
||||
ammo_type = /obj/item/reagent_containers/food/snacks/gumball/cyborg
|
||||
nodamage = TRUE
|
||||
|
||||
/obj/item/projectile/bullet/reusable/gumball/handle_drop()
|
||||
if(!dropped)
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/item/reagent_containers/food/snacks/gumball/S = new ammo_type(T)
|
||||
S.color = color
|
||||
dropped = TRUE
|
||||
|
||||
/obj/item/ammo_casing/caseless/lollipop //NEEDS RANDOMIZED COLOR LOGIC.
|
||||
name = "Lollipop"
|
||||
desc = "Why are you seeing this?!"
|
||||
projectile_type = /obj/item/projectile/bullet/reusable/lollipop
|
||||
click_cooldown_override = 2
|
||||
|
||||
/obj/item/projectile/bullet/reusable/lollipop
|
||||
name = "lollipop"
|
||||
desc = "Oh noes! A fast-moving lollipop!"
|
||||
icon_state = "lollipop_1"
|
||||
ammo_type = /obj/item/reagent_containers/food/snacks/lollipop/cyborg
|
||||
var/color2 = rgb(0, 0, 0)
|
||||
nodamage = TRUE
|
||||
|
||||
/obj/item/projectile/bullet/reusable/lollipop/New()
|
||||
var/obj/item/reagent_containers/food/snacks/lollipop/S = new ammo_type(src)
|
||||
color2 = S.headcolor
|
||||
var/mutable_appearance/head = mutable_appearance('icons/obj/projectiles.dmi', "lollipop_2")
|
||||
head.color = color2
|
||||
add_overlay(head)
|
||||
|
||||
/obj/item/projectile/bullet/reusable/lollipop/handle_drop()
|
||||
if(!dropped)
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/item/reagent_containers/food/snacks/lollipop/S = new ammo_type(T)
|
||||
S.change_head_color(color2)
|
||||
dropped = TRUE
|
||||
|
||||
#define PKBORG_DAMPEN_CYCLE_DELAY 20
|
||||
|
||||
//Peacekeeper Cyborg Projectile Dampenening Field
|
||||
/obj/item/borg/projectile_dampen
|
||||
name = "\improper Hyperkinetic Dampening projector"
|
||||
desc = "A device that projects a dampening field that weakens kinetic energy above a certain threshold. <span class='boldnotice'>Projects a field that drains power per second while active, that will weaken and slow damaging projectiles inside its field.</span> Still being a prototype, it tends to induce a charge on ungrounded metallic surfaces."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "shield"
|
||||
var/maxenergy = 1500
|
||||
var/energy = 1500
|
||||
var/energy_recharge = 7.5
|
||||
var/energy_recharge_cyborg_drain_coefficient = 0.4
|
||||
var/cyborg_cell_critical_percentage = 0.05
|
||||
var/mob/living/silicon/robot/host = null
|
||||
var/datum/proximity_monitor/advanced/dampening_field
|
||||
var/projectile_damage_coefficient = 0.5
|
||||
var/projectile_damage_tick_ecost_coefficient = 2 //Lasers get half their damage chopped off, drains 50 power/tick. Note that fields are processed 5 times per second.
|
||||
var/projectile_speed_coefficient = 1.5 //Higher the coefficient slower the projectile.
|
||||
var/projectile_tick_speed_ecost = 15
|
||||
var/list/obj/item/projectile/tracked
|
||||
var/image/projectile_effect
|
||||
var/field_radius = 3
|
||||
var/active = FALSE
|
||||
var/cycle_delay = 0
|
||||
|
||||
/obj/item/borg/projectile_dampen/debug
|
||||
maxenergy = 50000
|
||||
energy = 50000
|
||||
energy_recharge = 5000
|
||||
|
||||
/obj/item/borg/projectile_dampen/Initialize()
|
||||
. = ..()
|
||||
projectile_effect = image('icons/effects/fields.dmi', "projectile_dampen_effect")
|
||||
tracked = list()
|
||||
icon_state = "shield0"
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
host = loc
|
||||
|
||||
/obj/item/borg/projectile_dampen/Destroy()
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
return ..()
|
||||
|
||||
/obj/item/borg/projectile_dampen/attack_self(mob/user)
|
||||
if(cycle_delay > world.time)
|
||||
to_chat(user, "<span class='boldwarning'>[src] is still recycling its projectors!</span>")
|
||||
return
|
||||
cycle_delay = world.time + PKBORG_DAMPEN_CYCLE_DELAY
|
||||
if(!active)
|
||||
if(!user.has_buckled_mobs())
|
||||
activate_field()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src]'s safety cutoff prevents you from activating it due to living beings being ontop of you!</span>")
|
||||
else
|
||||
deactivate_field()
|
||||
update_icon()
|
||||
to_chat(user, "<span class='boldnotice'>You [active? "activate":"deactivate"] [src].</span>")
|
||||
|
||||
/obj/item/borg/projectile_dampen/update_icon()
|
||||
icon_state = "[initial(icon_state)][active]"
|
||||
|
||||
/obj/item/borg/projectile_dampen/proc/activate_field()
|
||||
if(istype(dampening_field))
|
||||
QDEL_NULL(dampening_field)
|
||||
dampening_field = make_field(/datum/proximity_monitor/advanced/peaceborg_dampener, list("current_range" = field_radius, "host" = src, "projector" = src))
|
||||
var/mob/living/silicon/robot/owner = get_host()
|
||||
if(owner)
|
||||
owner.module.allow_riding = FALSE
|
||||
active = TRUE
|
||||
|
||||
/obj/item/borg/projectile_dampen/proc/deactivate_field()
|
||||
QDEL_NULL(dampening_field)
|
||||
visible_message("<span class='warning'>\The [src] shuts off!</span>")
|
||||
for(var/P in tracked)
|
||||
restore_projectile(P)
|
||||
active = FALSE
|
||||
|
||||
var/mob/living/silicon/robot/owner = get_host()
|
||||
if(owner)
|
||||
owner.module.allow_riding = TRUE
|
||||
|
||||
/obj/item/borg/projectile_dampen/proc/get_host()
|
||||
if(istype(host))
|
||||
return host
|
||||
else
|
||||
if(iscyborg(host.loc))
|
||||
return host.loc
|
||||
return null
|
||||
|
||||
/obj/item/borg/projectile_dampen/dropped()
|
||||
. = ..()
|
||||
host = loc
|
||||
|
||||
/obj/item/borg/projectile_dampen/equipped()
|
||||
. = ..()
|
||||
host = loc
|
||||
|
||||
/obj/item/borg/projectile_dampen/on_mob_death()
|
||||
deactivate_field()
|
||||
. = ..()
|
||||
|
||||
/obj/item/borg/projectile_dampen/process()
|
||||
process_recharge()
|
||||
process_usage()
|
||||
update_location()
|
||||
|
||||
/obj/item/borg/projectile_dampen/proc/update_location()
|
||||
if(dampening_field)
|
||||
dampening_field.HandleMove()
|
||||
|
||||
/obj/item/borg/projectile_dampen/proc/process_usage()
|
||||
var/usage = 0
|
||||
for(var/I in tracked)
|
||||
var/obj/item/projectile/P = I
|
||||
if(!P.stun && P.nodamage) //No damage
|
||||
continue
|
||||
usage += projectile_tick_speed_ecost
|
||||
usage += (tracked[I] * projectile_damage_tick_ecost_coefficient)
|
||||
energy = CLAMP(energy - usage, 0, maxenergy)
|
||||
if(energy <= 0)
|
||||
deactivate_field()
|
||||
visible_message("<span class='warning'>[src] blinks \"ENERGY DEPLETED\".</span>")
|
||||
|
||||
/obj/item/borg/projectile_dampen/proc/process_recharge()
|
||||
if(!istype(host))
|
||||
if(iscyborg(host.loc))
|
||||
host = host.loc
|
||||
else
|
||||
energy = CLAMP(energy + energy_recharge, 0, maxenergy)
|
||||
return
|
||||
if(host.cell && (host.cell.charge >= (host.cell.maxcharge * cyborg_cell_critical_percentage)) && (energy < maxenergy))
|
||||
host.cell.use(energy_recharge*energy_recharge_cyborg_drain_coefficient)
|
||||
energy += energy_recharge
|
||||
|
||||
/obj/item/borg/projectile_dampen/proc/dampen_projectile(obj/item/projectile/P, track_projectile = TRUE)
|
||||
if(tracked[P])
|
||||
return
|
||||
if(track_projectile)
|
||||
tracked[P] = P.damage
|
||||
P.damage *= projectile_damage_coefficient
|
||||
P.speed *= projectile_speed_coefficient
|
||||
P.add_overlay(projectile_effect)
|
||||
|
||||
/obj/item/borg/projectile_dampen/proc/restore_projectile(obj/item/projectile/P)
|
||||
tracked -= P
|
||||
P.damage *= (1/projectile_damage_coefficient)
|
||||
P.speed *= (1/projectile_speed_coefficient)
|
||||
P.cut_overlay(projectile_effect)
|
||||
|
||||
/**********************************************************************
|
||||
HUD/SIGHT things
|
||||
***********************************************************************/
|
||||
/obj/item/borg/sight
|
||||
var/sight_mode = null
|
||||
|
||||
|
||||
/obj/item/borg/sight/xray
|
||||
name = "\proper X-ray vision"
|
||||
icon = 'icons/obj/decals.dmi'
|
||||
icon_state = "securearea"
|
||||
sight_mode = BORGXRAY
|
||||
|
||||
/obj/item/borg/sight/xray/truesight_lens
|
||||
name = "truesight lens"
|
||||
icon = 'icons/obj/clockwork_objects.dmi'
|
||||
icon_state = "truesight_lens"
|
||||
|
||||
/obj/item/borg/sight/thermal
|
||||
name = "\proper thermal vision"
|
||||
sight_mode = BORGTHERM
|
||||
icon_state = "thermal"
|
||||
|
||||
|
||||
/obj/item/borg/sight/meson
|
||||
name = "\proper meson vision"
|
||||
sight_mode = BORGMESON
|
||||
icon_state = "meson"
|
||||
|
||||
/obj/item/borg/sight/material
|
||||
name = "\proper material vision"
|
||||
sight_mode = BORGMATERIAL
|
||||
icon_state = "material"
|
||||
|
||||
/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"
|
||||
|
||||
/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"
|
||||
|
||||
/obj/item/borg/sight/hud/sec/New()
|
||||
..()
|
||||
hud = new /obj/item/clothing/glasses/hud/security(src)
|
||||
return
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
Grippers oh god oh fuck
|
||||
***********************************************************************/
|
||||
|
||||
/obj/item/weapon/gripper
|
||||
name = "circuit gripper"
|
||||
desc = "A simple grasping tool for inserting circuitboards into machinary."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "gripper"
|
||||
|
||||
item_flags = NOBLUDGEON
|
||||
|
||||
//Has a list of items that it can hold.
|
||||
var/list/can_hold = list(
|
||||
/obj/item/circuitboard
|
||||
)
|
||||
|
||||
var/obj/item/wrapped = null // Item currently being held.
|
||||
|
||||
/obj/item/weapon/gripper/attack_self()
|
||||
if(wrapped)
|
||||
wrapped.forceMove(get_turf(wrapped))
|
||||
wrapped = null
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gripper/afterattack(var/atom/target, var/mob/living/user, proximity, params)
|
||||
|
||||
if(!proximity)
|
||||
return
|
||||
|
||||
if(!wrapped)
|
||||
for(var/obj/item/thing in src.contents)
|
||||
wrapped = thing
|
||||
break
|
||||
|
||||
if(wrapped) //Already have an item.
|
||||
//Temporary put wrapped into user so target's attackby() checks pass.
|
||||
wrapped.loc = user
|
||||
|
||||
//Pass the attack on to the target. This might delete/relocate wrapped.
|
||||
var/resolved = target.attackby(wrapped,user)
|
||||
if(!resolved && wrapped && target)
|
||||
wrapped.afterattack(target,user,1)
|
||||
//If wrapped was neither deleted nor put into target, put it back into the gripper.
|
||||
if(wrapped && user && (wrapped.loc == user))
|
||||
wrapped.loc = src
|
||||
else
|
||||
wrapped = null
|
||||
return
|
||||
|
||||
else if(istype(target,/obj/item))
|
||||
|
||||
var/obj/item/I = target
|
||||
|
||||
var/grab = 0
|
||||
for(var/typepath in can_hold)
|
||||
if(istype(I,typepath))
|
||||
grab = 1
|
||||
break
|
||||
|
||||
//We can grab the item, finally.
|
||||
if(grab)
|
||||
to_chat(user, "You collect \the [I].")
|
||||
I.loc = src
|
||||
wrapped = I
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='danger'>Your gripper cannot hold \the [target].</span>")
|
||||
@@ -0,0 +1,713 @@
|
||||
// robot_upgrades.dm
|
||||
// Contains various borg upgrades.
|
||||
|
||||
/obj/item/borg/upgrade
|
||||
name = "borg upgrade module."
|
||||
desc = "Protected by FRM."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "cyborg_upgrade"
|
||||
var/locked = FALSE
|
||||
var/installed = 0
|
||||
var/require_module = 0
|
||||
var/list/module_type
|
||||
// if true, is not stored in the robot to be ejected
|
||||
// if module is reset
|
||||
var/one_use = FALSE
|
||||
|
||||
/obj/item/borg/upgrade/proc/action(mob/living/silicon/robot/R, user = usr)
|
||||
if(R.stat == DEAD)
|
||||
to_chat(user, "<span class='notice'>[src] will not function on a deceased cyborg.</span>")
|
||||
return FALSE
|
||||
if(module_type && !is_type_in_list(R.module, module_type))
|
||||
to_chat(R, "Upgrade mounting error! No suitable hardpoint detected!")
|
||||
to_chat(user, "There's no mounting point for the module!")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/borg/upgrade/proc/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
if (!(src in R.upgrades))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/borg/upgrade/rename
|
||||
name = "cyborg reclassification board"
|
||||
desc = "Used to rename a cyborg."
|
||||
icon_state = "cyborg_upgrade1"
|
||||
var/heldname = ""
|
||||
one_use = TRUE
|
||||
|
||||
/obj/item/borg/upgrade/rename/attack_self(mob/user)
|
||||
heldname = stripped_input(user, "Enter new robot name", "Cyborg Reclassification", heldname, MAX_NAME_LEN)
|
||||
|
||||
/obj/item/borg/upgrade/rename/action(mob/living/silicon/robot/R)
|
||||
. = ..()
|
||||
if(.)
|
||||
var/oldname = R.real_name
|
||||
R.custom_name = heldname
|
||||
R.updatename()
|
||||
if(oldname == R.real_name)
|
||||
R.notify_ai(RENAME, oldname, R.real_name)
|
||||
|
||||
/obj/item/borg/upgrade/restart
|
||||
name = "cyborg emergency reboot module"
|
||||
desc = "Used to force a reboot of a disabled-but-repaired cyborg, bringing it back online."
|
||||
icon_state = "cyborg_upgrade1"
|
||||
one_use = TRUE
|
||||
|
||||
/obj/item/borg/upgrade/restart/action(mob/living/silicon/robot/R, user = usr)
|
||||
if(R.health < 0)
|
||||
to_chat(user, "<span class='warning'>You have to repair the cyborg before using this module!</span>")
|
||||
return FALSE
|
||||
|
||||
if(R.mind)
|
||||
R.mind.grab_ghost()
|
||||
playsound(loc, 'sound/voice/liveagain.ogg', 75, 1)
|
||||
|
||||
R.revive()
|
||||
|
||||
/obj/item/borg/upgrade/vtec
|
||||
name = "cyborg VTEC module"
|
||||
desc = "Used to kick in a cyborg's VTEC systems, increasing their speed."
|
||||
icon_state = "cyborg_upgrade2"
|
||||
require_module = 1
|
||||
|
||||
/obj/item/borg/upgrade/vtec/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(R.speed < 0)
|
||||
to_chat(R, "<span class='notice'>A VTEC unit is already installed!</span>")
|
||||
to_chat(user, "<span class='notice'>There's no room for another VTEC unit!</span>")
|
||||
return FALSE
|
||||
|
||||
//R.speed = -2 // Gotta go fast.
|
||||
//Citadel change - makes vtecs give an ability rather than reducing the borg's speed instantly
|
||||
R.AddAbility(new/obj/effect/proc_holder/silicon/cyborg/vtecControl)
|
||||
|
||||
/obj/item/borg/upgrade/vtec/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
R.speed = initial(R.speed)
|
||||
|
||||
/obj/item/borg/upgrade/disablercooler
|
||||
name = "cyborg rapid energy blaster cooling module"
|
||||
desc = "Used to cool a mounted energy-based firearm, increasing the potential current in it and thus its recharge rate."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
require_module = 1
|
||||
|
||||
/obj/item/borg/upgrade/disablercooler/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
var/successflag
|
||||
for(var/obj/item/gun/energy/T in R.module.modules)
|
||||
if(T.charge_delay <= 2)
|
||||
successflag = successflag || 2
|
||||
continue
|
||||
T.charge_delay = max(2, T.charge_delay - 4)
|
||||
successflag = 1
|
||||
if(!successflag)
|
||||
to_chat(user, "<span class='notice'>There's no energy-based firearm in this unit!</span>")
|
||||
return FALSE
|
||||
if(successflag == 2)
|
||||
to_chat(R, "<span class='notice'>A cooling unit is already installed!</span>")
|
||||
to_chat(user, "<span class='notice'>There's no room for another cooling unit!</span>")
|
||||
return FALSE
|
||||
|
||||
/obj/item/borg/upgrade/disablercooler/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
for(var/obj/item/gun/energy/T in R.module.modules)
|
||||
T.charge_delay = initial(T.charge_delay)
|
||||
return .
|
||||
return FALSE
|
||||
|
||||
/obj/item/borg/upgrade/thrusters
|
||||
name = "ion thruster upgrade"
|
||||
desc = "An energy-operated thruster system for cyborgs."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
|
||||
/obj/item/borg/upgrade/thrusters/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(R.ionpulse)
|
||||
to_chat(user, "<span class='notice'>This unit already has ion thrusters installed!</span>")
|
||||
return FALSE
|
||||
|
||||
R.ionpulse = TRUE
|
||||
|
||||
/obj/item/borg/upgrade/thrusters/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
R.ionpulse = FALSE
|
||||
|
||||
/obj/item/borg/upgrade/ddrill
|
||||
name = "mining cyborg diamond drill"
|
||||
desc = "A diamond drill replacement for the mining module's standard drill."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
require_module = 1
|
||||
module_type = list(/obj/item/robot_module/miner)
|
||||
|
||||
/obj/item/borg/upgrade/ddrill/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
for(var/obj/item/pickaxe/drill/cyborg/D in R.module)
|
||||
R.module.remove_module(D, TRUE)
|
||||
for(var/obj/item/shovel/S in R.module)
|
||||
R.module.remove_module(S, TRUE)
|
||||
|
||||
var/obj/item/pickaxe/drill/cyborg/diamond/DD = new /obj/item/pickaxe/drill/cyborg/diamond(R.module)
|
||||
R.module.basic_modules += DD
|
||||
R.module.add_module(DD, FALSE, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/ddrill/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
for(var/obj/item/pickaxe/drill/cyborg/diamond/DD in R.module)
|
||||
R.module.remove_module(DD, TRUE)
|
||||
|
||||
var/obj/item/pickaxe/drill/cyborg/D = new (R.module)
|
||||
R.module.basic_modules += D
|
||||
R.module.add_module(D, FALSE, TRUE)
|
||||
var/obj/item/shovel/S = new (R.module)
|
||||
R.module.basic_modules += S
|
||||
R.module.add_module(S, FALSE, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/soh
|
||||
name = "mining cyborg satchel of holding"
|
||||
desc = "A satchel of holding replacement for mining cyborg's ore satchel module."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
require_module = 1
|
||||
module_type = list(/obj/item/robot_module/miner)
|
||||
|
||||
/obj/item/borg/upgrade/soh/action(mob/living/silicon/robot/R)
|
||||
. = ..()
|
||||
if(.)
|
||||
for(var/obj/item/storage/bag/ore/cyborg/S in R.module)
|
||||
R.module.remove_module(S, TRUE)
|
||||
|
||||
var/obj/item/storage/bag/ore/holding/H = new /obj/item/storage/bag/ore/holding(R.module)
|
||||
R.module.basic_modules += H
|
||||
R.module.add_module(H, FALSE, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/soh/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
for(var/obj/item/storage/bag/ore/holding/H in R.module)
|
||||
R.module.remove_module(H, TRUE)
|
||||
|
||||
var/obj/item/storage/bag/ore/cyborg/S = new (R.module)
|
||||
R.module.basic_modules += S
|
||||
R.module.add_module(S, FALSE, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/tboh
|
||||
name = "janitor cyborg trash bag of holding"
|
||||
desc = "A trash bag of holding replacement for the janiborg's standard trash bag."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
require_module = 1
|
||||
module_type = list(/obj/item/robot_module/butler)
|
||||
|
||||
/obj/item/borg/upgrade/tboh/action(mob/living/silicon/robot/R)
|
||||
. = ..()
|
||||
if(.)
|
||||
for(var/obj/item/storage/bag/trash/cyborg/TB in R.module.modules)
|
||||
R.module.remove_module(TB, TRUE)
|
||||
|
||||
var/obj/item/storage/bag/trash/bluespace/cyborg/B = new /obj/item/storage/bag/trash/bluespace/cyborg(R.module)
|
||||
R.module.basic_modules += B
|
||||
R.module.add_module(B, FALSE, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/tboh/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
for(var/obj/item/storage/bag/trash/bluespace/cyborg/B in R.module.modules)
|
||||
R.module.remove_module(B, TRUE)
|
||||
|
||||
var/obj/item/storage/bag/trash/cyborg/TB = new (R.module)
|
||||
R.module.basic_modules += TB
|
||||
R.module.add_module(TB, FALSE, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/amop
|
||||
name = "janitor cyborg advanced mop"
|
||||
desc = "An advanced mop replacement for the janiborg's standard mop."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
require_module = 1
|
||||
module_type = list(/obj/item/robot_module/butler)
|
||||
|
||||
/obj/item/borg/upgrade/amop/action(mob/living/silicon/robot/R)
|
||||
. = ..()
|
||||
if(.)
|
||||
for(var/obj/item/mop/cyborg/M in R.module.modules)
|
||||
R.module.remove_module(M, TRUE)
|
||||
|
||||
var/obj/item/mop/advanced/cyborg/A = new /obj/item/mop/advanced/cyborg(R.module)
|
||||
R.module.basic_modules += A
|
||||
R.module.add_module(A, FALSE, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/amop/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
for(var/obj/item/mop/advanced/cyborg/A in R.module.modules)
|
||||
R.module.remove_module(A, TRUE)
|
||||
|
||||
var/obj/item/mop/cyborg/M = new (R.module)
|
||||
R.module.basic_modules += M
|
||||
R.module.add_module(M, FALSE, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/syndicate
|
||||
name = "illegal equipment module"
|
||||
desc = "Unlocks the hidden, deadlier functions of a cyborg."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
require_module = 1
|
||||
|
||||
/obj/item/borg/upgrade/syndicate/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(R.emagged)
|
||||
return FALSE
|
||||
|
||||
R.SetEmagged(1)
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/item/borg/upgrade/syndicate/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
R.SetEmagged(FALSE)
|
||||
|
||||
/obj/item/borg/upgrade/lavaproof
|
||||
name = "mining cyborg lavaproof tracks"
|
||||
desc = "An upgrade kit to apply specialized coolant systems and insulation layers to mining cyborg tracks, enabling them to withstand exposure to molten rock."
|
||||
icon_state = "ash_plating"
|
||||
resistance_flags = LAVA_PROOF | FIRE_PROOF
|
||||
require_module = 1
|
||||
module_type = list(/obj/item/robot_module/miner)
|
||||
|
||||
/obj/item/borg/upgrade/lavaproof/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
R.weather_immunities += "lava"
|
||||
|
||||
/obj/item/borg/upgrade/lavaproof/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
R.weather_immunities -= "lava"
|
||||
|
||||
/obj/item/borg/upgrade/selfrepair
|
||||
name = "self-repair module"
|
||||
desc = "This module will repair the cyborg over time."
|
||||
icon_state = "cyborg_upgrade5"
|
||||
require_module = 1
|
||||
var/repair_amount = -1
|
||||
var/repair_tick = 1
|
||||
var/msg_cooldown = 0
|
||||
var/on = FALSE
|
||||
var/powercost = 10
|
||||
var/mob/living/silicon/robot/cyborg
|
||||
var/datum/action/toggle_action
|
||||
|
||||
/obj/item/borg/upgrade/selfrepair/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
var/obj/item/borg/upgrade/selfrepair/U = locate() in R
|
||||
if(U)
|
||||
to_chat(user, "<span class='warning'>This unit is already equipped with a self-repair module.</span>")
|
||||
return FALSE
|
||||
|
||||
cyborg = R
|
||||
icon_state = "selfrepair_off"
|
||||
toggle_action = new /datum/action/item_action/toggle(src)
|
||||
toggle_action.Grant(R)
|
||||
|
||||
/obj/item/borg/upgrade/selfrepair/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
toggle_action.Remove(cyborg)
|
||||
QDEL_NULL(toggle_action)
|
||||
cyborg = null
|
||||
deactivate_sr()
|
||||
|
||||
/obj/item/borg/upgrade/selfrepair/dropped()
|
||||
. = ..()
|
||||
addtimer(CALLBACK(src, .proc/check_dropped), 1)
|
||||
|
||||
/obj/item/borg/upgrade/selfrepair/proc/check_dropped()
|
||||
if(loc != cyborg)
|
||||
toggle_action.Remove(cyborg)
|
||||
QDEL_NULL(toggle_action)
|
||||
cyborg = null
|
||||
deactivate_sr()
|
||||
|
||||
/obj/item/borg/upgrade/selfrepair/ui_action_click()
|
||||
on = !on
|
||||
if(on)
|
||||
to_chat(cyborg, "<span class='notice'>You activate the self-repair module.</span>")
|
||||
START_PROCESSING(SSobj, src)
|
||||
else
|
||||
to_chat(cyborg, "<span class='notice'>You deactivate the self-repair module.</span>")
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/borg/upgrade/selfrepair/update_icon()
|
||||
if(cyborg)
|
||||
icon_state = "selfrepair_[on ? "on" : "off"]"
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
else
|
||||
icon_state = "cyborg_upgrade5"
|
||||
|
||||
/obj/item/borg/upgrade/selfrepair/proc/deactivate_sr()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
on = FALSE
|
||||
update_icon()
|
||||
|
||||
/obj/item/borg/upgrade/selfrepair/process()
|
||||
if(!repair_tick)
|
||||
repair_tick = 1
|
||||
return
|
||||
|
||||
if(cyborg && (cyborg.stat != DEAD) && on)
|
||||
if(!cyborg.cell)
|
||||
to_chat(cyborg, "<span class='warning'>Self-repair module deactivated. Please, insert the power cell.</span>")
|
||||
deactivate_sr()
|
||||
return
|
||||
|
||||
if(cyborg.cell.charge < powercost * 2)
|
||||
to_chat(cyborg, "<span class='warning'>Self-repair module deactivated. Please recharge.</span>")
|
||||
deactivate_sr()
|
||||
return
|
||||
|
||||
if(cyborg.health < cyborg.maxHealth)
|
||||
if(cyborg.health < 0)
|
||||
repair_amount = -2.5
|
||||
powercost = 30
|
||||
else
|
||||
repair_amount = -1
|
||||
powercost = 10
|
||||
cyborg.adjustBruteLoss(repair_amount)
|
||||
cyborg.adjustFireLoss(repair_amount)
|
||||
cyborg.updatehealth()
|
||||
cyborg.cell.use(powercost)
|
||||
else
|
||||
cyborg.cell.use(5)
|
||||
repair_tick = 0
|
||||
|
||||
if((world.time - 2000) > msg_cooldown )
|
||||
var/msgmode = "standby"
|
||||
if(cyborg.health < 0)
|
||||
msgmode = "critical"
|
||||
else if(cyborg.health < cyborg.maxHealth)
|
||||
msgmode = "normal"
|
||||
to_chat(cyborg, "<span class='notice'>Self-repair is active in <span class='boldnotice'>[msgmode]</span> mode.</span>")
|
||||
msg_cooldown = world.time
|
||||
else
|
||||
deactivate_sr()
|
||||
|
||||
/obj/item/borg/upgrade/hypospray
|
||||
name = "medical cyborg hypospray advanced synthesiser"
|
||||
desc = "An upgrade to the Medical module cyborg's hypospray, allowing it \
|
||||
to produce more advanced and complex medical reagents."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
require_module = 1
|
||||
module_type = list(/obj/item/robot_module/medical,
|
||||
/obj/item/robot_module/syndicate_medical,
|
||||
/obj/item/robot_module/medihound)
|
||||
var/list/additional_reagents = list()
|
||||
|
||||
/obj/item/borg/upgrade/hypospray/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
|
||||
if(H.accepts_reagent_upgrades)
|
||||
for(var/re in additional_reagents)
|
||||
H.add_reagent(re)
|
||||
|
||||
/obj/item/borg/upgrade/hypospray/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
|
||||
if(H.accepts_reagent_upgrades)
|
||||
for(var/re in additional_reagents)
|
||||
H.del_reagent(re)
|
||||
|
||||
/obj/item/borg/upgrade/hypospray/expanded
|
||||
name = "medical cyborg expanded hypospray"
|
||||
desc = "An upgrade to the Medical module's hypospray, allowing it \
|
||||
to treat a wider range of conditions and problems."
|
||||
additional_reagents = list("mannitol", "oculine", "inacusiate",
|
||||
"mutadone", "haloperidol")
|
||||
|
||||
/obj/item/borg/upgrade/hypospray/high_strength
|
||||
name = "medical cyborg high-strength hypospray"
|
||||
desc = "An upgrade to the Medical module's hypospray, containing \
|
||||
stronger versions of existing chemicals."
|
||||
additional_reagents = list("oxandrolone", "sal_acid", "rezadone",
|
||||
"pen_acid")
|
||||
|
||||
/obj/item/borg/upgrade/piercing_hypospray
|
||||
name = "cyborg piercing hypospray"
|
||||
desc = "An upgrade to a cyborg's hypospray, allowing it to \
|
||||
pierce armor and thick material."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
|
||||
/obj/item/borg/upgrade/piercing_hypospray/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
var/found_hypo = FALSE
|
||||
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
|
||||
H.bypass_protection = TRUE
|
||||
found_hypo = TRUE
|
||||
|
||||
if(!found_hypo)
|
||||
return FALSE
|
||||
|
||||
/obj/item/borg/upgrade/piercing_hypospray/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
for(var/obj/item/reagent_containers/borghypo/H in R.module.modules)
|
||||
H.bypass_protection = initial(H.bypass_protection)
|
||||
|
||||
/obj/item/borg/upgrade/defib
|
||||
name = "medical cyborg defibrillator"
|
||||
desc = "An upgrade to the Medical module, installing a built-in \
|
||||
defibrillator, for on the scene revival."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
require_module = 1
|
||||
module_type = list(/obj/item/robot_module/medical,
|
||||
/obj/item/robot_module/syndicate_medical,
|
||||
/obj/item/robot_module/medihound)
|
||||
|
||||
/obj/item/borg/upgrade/defib/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
var/obj/item/twohanded/shockpaddles/cyborg/S = new(R.module)
|
||||
R.module.basic_modules += S
|
||||
R.module.add_module(S, FALSE, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/defib/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
var/obj/item/twohanded/shockpaddles/cyborg/S = locate() in R.module
|
||||
R.module.remove_module(S, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/processor
|
||||
name = "medical cyborg surgical processor"
|
||||
desc = "An upgrade to the Medical module, installing a processor \
|
||||
capable of scanning surgery disks and carrying \
|
||||
out procedures"
|
||||
icon_state = "cyborg_upgrade3"
|
||||
require_module = 1
|
||||
module_type = list(/obj/item/robot_module/medical,
|
||||
/obj/item/robot_module/syndicate_medical,
|
||||
/obj/item/robot_module/medihound)
|
||||
|
||||
/obj/item/borg/upgrade/processor/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
var/obj/item/surgical_processor/SP = new(R.module)
|
||||
R.module.basic_modules += SP
|
||||
R.module.add_module(SP, FALSE, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/processor/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
var/obj/item/surgical_processor/SP = locate() in R.module
|
||||
R.module.remove_module(SP, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/advhealth
|
||||
name = "advanced cyborg health scanner"
|
||||
desc = "An upgrade to the Medical modules, installing a built-in \
|
||||
advanced health scanner, for better readings on patients."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
require_module = 1
|
||||
module_type = list(
|
||||
/obj/item/robot_module/medical,
|
||||
/obj/item/robot_module/syndicate_medical,
|
||||
/obj/item/robot_module/medihound)
|
||||
|
||||
/obj/item/borg/upgrade/advhealth/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
var/obj/item/healthanalyzer/advanced/AH = new(R.module)
|
||||
R.module.basic_modules += AH
|
||||
R.module.add_module(AH, FALSE, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/processor/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
var/obj/item/healthanalyzer/advanced/AH = locate() in R.module
|
||||
R.module.remove_module(AH, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/ai
|
||||
name = "B.O.R.I.S. module"
|
||||
desc = "Bluespace Optimized Remote Intelligence Synchronization. An uplink device which takes the place of an MMI in cyborg endoskeletons, creating a robotic shell controlled by an AI."
|
||||
icon_state = "boris"
|
||||
|
||||
/obj/item/borg/upgrade/ai/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(R.shell)
|
||||
to_chat(user, "<span class='warning'>This unit is already an AI shell!</span>")
|
||||
return FALSE
|
||||
if(R.key) //You cannot replace a player unless the key is completely removed.
|
||||
to_chat(user, "<span class='warning'>Intelligence patterns detected in this [R.braintype]. Aborting.</span>")
|
||||
return FALSE
|
||||
|
||||
R.make_shell(src)
|
||||
|
||||
/obj/item/borg/upgrade/ai/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
if(R.shell)
|
||||
R.undeploy()
|
||||
R.notify_ai(AI_SHELL)
|
||||
|
||||
/obj/item/borg/upgrade/expand
|
||||
name = "borg expander"
|
||||
desc = "A cyborg resizer, it makes a cyborg huge."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
|
||||
/obj/item/borg/upgrade/expand/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
|
||||
if(R.hasExpanded)
|
||||
to_chat(usr, "<span class='notice'>This unit already has an expand module installed!</span>")
|
||||
return FALSE
|
||||
|
||||
R.notransform = TRUE
|
||||
var/prev_lockcharge = R.lockcharge
|
||||
R.SetLockdown(1)
|
||||
R.anchored = TRUE
|
||||
var/datum/effect_system/smoke_spread/smoke = new
|
||||
smoke.set_up(1, R.loc)
|
||||
smoke.start()
|
||||
sleep(2)
|
||||
for(var/i in 1 to 4)
|
||||
playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, 1, -1)
|
||||
sleep(12)
|
||||
if(!prev_lockcharge)
|
||||
R.SetLockdown(0)
|
||||
R.anchored = FALSE
|
||||
R.notransform = FALSE
|
||||
R.resize = 2
|
||||
R.hasExpanded = TRUE
|
||||
R.update_transform()
|
||||
|
||||
/obj/item/borg/upgrade/expand/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
R.resize = 0.5
|
||||
R.hasExpanded = FALSE
|
||||
R.update_transform()
|
||||
|
||||
/obj/item/borg/upgrade/rped
|
||||
name = "engineering cyborg BSRPED"
|
||||
desc = "A rapid part exchange device for the engineering cyborg."
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "borg_BS_RPED"
|
||||
require_module = TRUE
|
||||
module_type = list(/obj/item/robot_module/engineering, /obj/item/robot_module/saboteur)
|
||||
|
||||
/obj/item/borg/upgrade/rped/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
|
||||
var/obj/item/storage/part_replacer/bluespace/cyborg/BSRPED = locate() in R
|
||||
var/obj/item/storage/part_replacer/cyborg/RPED = locate() in R
|
||||
if(!RPED)
|
||||
RPED = locate() in R.module
|
||||
if(!BSRPED)
|
||||
BSRPED = locate() in R.module //There's gotta be a smarter way to do this.
|
||||
if(BSRPED)
|
||||
to_chat(user, "<span class='warning'>This unit is already equipped with a BSRPED module.</span>")
|
||||
return FALSE
|
||||
|
||||
BSRPED = new(R.module)
|
||||
SEND_SIGNAL(RPED, COMSIG_TRY_STORAGE_QUICK_EMPTY)
|
||||
qdel(RPED)
|
||||
R.module.basic_modules += BSRPED
|
||||
R.module.add_module(BSRPED, FALSE, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/rped/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
var/obj/item/storage/part_replacer/cyborg/RPED = locate() in R.module
|
||||
if (RPED)
|
||||
R.module.remove_module(RPED, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/pinpointer
|
||||
name = "medical cyborg crew pinpointer"
|
||||
desc = "A crew pinpointer module for the medical cyborg."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "pinpointer_crew"
|
||||
require_module = TRUE
|
||||
module_type = list(/obj/item/robot_module/medical,
|
||||
/obj/item/robot_module/syndicate_medical,
|
||||
/obj/item/robot_module/medihound)
|
||||
|
||||
/obj/item/borg/upgrade/pinpointer/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
|
||||
var/obj/item/pinpointer/crew/PP = locate() in R
|
||||
if(PP)
|
||||
to_chat(user, "<span class='warning'>This unit is already equipped with a pinpointer module.</span>")
|
||||
return FALSE
|
||||
|
||||
PP = new(R.module)
|
||||
R.module.basic_modules += PP
|
||||
R.module.add_module(PP, FALSE, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/pinpointer/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
var/obj/item/pinpointer/crew/PP = locate() in R.module
|
||||
if (PP)
|
||||
R.module.remove_module(PP, TRUE)
|
||||
|
||||
/obj/item/borg/upgrade/transform
|
||||
name = "borg module picker (Standard)"
|
||||
desc = "Allows you to to turn a cyborg into a standard cyborg."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
var/obj/item/robot_module/new_module = /obj/item/robot_module/standard
|
||||
|
||||
/obj/item/borg/upgrade/transform/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
R.module.transform_to(new_module)
|
||||
|
||||
/obj/item/borg/upgrade/transform/clown
|
||||
name = "borg module picker (Clown)"
|
||||
desc = "Allows you to to turn a cyborg into a clown, honk."
|
||||
icon_state = "cyborg_upgrade3"
|
||||
new_module = /obj/item/robot_module/clown
|
||||
|
||||
// Citadel's Vtech Controller
|
||||
/obj/effect/proc_holder/silicon/cyborg/vtecControl
|
||||
name = "vTec Control"
|
||||
desc = "Allows finer-grained control of the vTec speed boost."
|
||||
action_icon = 'icons/mob/actions.dmi'
|
||||
action_icon_state = "Chevron_State_0"
|
||||
|
||||
var/currentState = 0
|
||||
var/maxReduction = 1
|
||||
|
||||
|
||||
/obj/effect/proc_holder/silicon/cyborg/vtecControl/Click(mob/living/silicon/robot/user)
|
||||
var/mob/living/silicon/robot/self = usr
|
||||
|
||||
currentState = (currentState + 1) % 3
|
||||
|
||||
if(istype(self))
|
||||
switch(currentState)
|
||||
if (0)
|
||||
self.speed = initial(self.speed)
|
||||
if (1)
|
||||
self.speed = initial(self.speed) - maxReduction * 0.5
|
||||
if (2)
|
||||
self.speed = initial(self.speed) - maxReduction * 1
|
||||
|
||||
action.button_icon_state = "Chevron_State_[currentState]"
|
||||
action.UpdateButtonIcon()
|
||||
|
||||
return
|
||||
Reference in New Issue
Block a user