mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-25 04:57:47 +01:00
some borg upgrade overhaul, power use function, bluespace pounce and some fixes (#15924)
* some borg upgrade overhaul * . * adjust icon some * . * fixes the borg hud store icon breaking * refactor borg skill power usage, add bluespace pounce * . * . * copy paste mistakes... * first check distance then drain power on leap * small oversight in the calculation * comment * second silicon hud store icon case
This commit is contained in:
@@ -297,7 +297,8 @@
|
||||
if(src.emagged)
|
||||
var/mob/living/silicon/robot/R = user
|
||||
var/mob/living/L = target
|
||||
if(R.cell.charge <= 666)
|
||||
if(!R.use_direct_power(666, 100))
|
||||
to_chat(user, span_warning("Warning, low power detected. Aborting action."))
|
||||
return
|
||||
L.Stun(1)
|
||||
L.Weaken(1)
|
||||
@@ -305,7 +306,6 @@
|
||||
L.visible_message("<span class='danger'>[user] has shocked [L] with its tongue!</span>", \
|
||||
"<span class='userdanger'>[user] has shocked you with its tongue! You can feel the betrayal.</span>")
|
||||
playsound(src, 'sound/weapons/Egloves.ogg', 50, 1, -1)
|
||||
R.cell.charge -= 666
|
||||
else
|
||||
user.visible_message("<span class='notice'>\The [user] affectionately licks all over \the [target]'s face!</span>", "<span class='notice'>You affectionately lick all over \the [target]'s face!</span>")
|
||||
playsound(src, 'sound/effects/attackblob.ogg', 50, 1)
|
||||
@@ -406,6 +406,7 @@
|
||||
desc = "Leap at your target to momentarily stun them."
|
||||
force = 0
|
||||
throwforce = 0
|
||||
var/bluespace = FALSE
|
||||
|
||||
/obj/item/weapon/dogborg/pounce/New()
|
||||
..()
|
||||
@@ -413,14 +414,16 @@
|
||||
|
||||
/obj/item/weapon/dogborg/pounce/attack_self(mob/user)
|
||||
var/mob/living/silicon/robot/R = user
|
||||
R.leap()
|
||||
R.leap(bluespace)
|
||||
|
||||
/mob/living/silicon/robot/proc/leap()
|
||||
/mob/living/silicon/robot/proc/leap(var/bluespace = FALSE)
|
||||
if(last_special > world.time)
|
||||
to_chat(src, "<span class='filter_notice'>Your leap actuators are still recharging.</span>")
|
||||
return
|
||||
|
||||
if(cell.charge < 1000)
|
||||
var/power_cost = bluespace ? 1000 : 750
|
||||
var/minimum_power = bluespace ? 2500 : 1000
|
||||
if(cell.charge < minimum_power)
|
||||
to_chat(src, "<span class='filter_notice'>Cell charge too low to continue.</span>")
|
||||
return
|
||||
|
||||
@@ -429,7 +432,8 @@
|
||||
return
|
||||
|
||||
var/list/choices = list()
|
||||
for(var/mob/living/M in view(3,src))
|
||||
var/leap_distance = bluespace ? 5 : 3
|
||||
for(var/mob/living/M in view(leap_distance,src))
|
||||
if(!istype(M,/mob/living/silicon))
|
||||
choices += M
|
||||
choices -= src
|
||||
@@ -438,7 +442,16 @@
|
||||
|
||||
if(!T || !src || src.stat) return
|
||||
|
||||
if(get_dist(get_turf(T), get_turf(src)) > 3) return
|
||||
if(get_dist(get_turf(T), get_turf(src)) > leap_distance) return
|
||||
|
||||
if(ishuman(T))
|
||||
var/mob/living/carbon/human/H = T
|
||||
if(H.get_species() == SPECIES_SHADEKIN && (H.ability_flags & AB_PHASE_SHIFTED))
|
||||
power_cost *= 2
|
||||
|
||||
if(!use_direct_power(power_cost, minimum_power - power_cost))
|
||||
to_chat(src, span_warning("Warning, low power detected. Aborting action."))
|
||||
return
|
||||
|
||||
if(last_special > world.time)
|
||||
return
|
||||
@@ -452,12 +465,16 @@
|
||||
pixel_y = pixel_y + 10
|
||||
|
||||
src.visible_message("<span class='danger'>\The [src] leaps at [T]!</span>")
|
||||
src.throw_at(get_step(get_turf(T),get_turf(src)), 4, 1, src)
|
||||
if(bluespace)
|
||||
src.forceMove(get_turf(T))
|
||||
T.hitby(src)
|
||||
else
|
||||
src.throw_at(get_step(get_turf(T),get_turf(src)), 4, 1, src)
|
||||
playsound(src, 'sound/mecha/mechstep2.ogg', 50, 1)
|
||||
pixel_y = default_pixel_y
|
||||
cell.charge -= 750
|
||||
|
||||
sleep(5)
|
||||
if(!bluespace)
|
||||
sleep(5)
|
||||
|
||||
if(status_flags & LEAPING) status_flags &= ~LEAPING
|
||||
|
||||
@@ -470,6 +487,7 @@
|
||||
if(H.species.lightweight == 1)
|
||||
H.Weaken(3)
|
||||
return
|
||||
|
||||
var/armor_block = run_armor_check(T, "melee")
|
||||
var/armor_soak = get_armor_soak(T, "melee")
|
||||
T.apply_damage(20, HALLOSS,, armor_block, armor_soak)
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
module_state_3:loc = module
|
||||
module_state_3 = null
|
||||
inv3.icon_state = "inv3"
|
||||
after_equip()
|
||||
update_icon()
|
||||
hud_used.update_robot_modules_display()
|
||||
|
||||
@@ -84,6 +85,7 @@
|
||||
module_state_3:loc = module
|
||||
module_state_3 = null
|
||||
inv3.icon_state = "inv3"
|
||||
after_equip()
|
||||
update_icon()
|
||||
|
||||
/mob/living/silicon/robot/proc/activated(obj/item/O)
|
||||
@@ -252,6 +254,23 @@
|
||||
sight_mode |= module_state_3:sight_mode
|
||||
else
|
||||
to_chat(src, "<span class='notice'>You need to disable a module first!</span>")
|
||||
return
|
||||
after_equip()
|
||||
|
||||
/mob/living/silicon/robot/proc/after_equip()
|
||||
if(sight_mode & BORGANOMALOUS)
|
||||
var/obj/item/weapon/dogborg/pounce/pounce = has_upgrade_module(/obj/item/weapon/dogborg/pounce)
|
||||
if(pounce)
|
||||
pounce.name = "bluespace pounce"
|
||||
pounce.icon_state = "bluespace_pounce"
|
||||
pounce.bluespace = TRUE
|
||||
else
|
||||
var/obj/item/weapon/dogborg/pounce/pounce = has_upgrade_module(/obj/item/weapon/dogborg/pounce)
|
||||
if(pounce)
|
||||
pounce.name = initial(pounce.name)
|
||||
pounce.icon_state = initial(pounce.icon_state)
|
||||
pounce.desc = initial(pounce.desc)
|
||||
pounce.bluespace = initial(pounce.bluespace)
|
||||
|
||||
/mob/living/silicon/robot/put_in_hands(var/obj/item/W) // No hands.
|
||||
W.loc = get_turf(src)
|
||||
@@ -271,4 +290,4 @@
|
||||
if(module_state_2)
|
||||
. += module_state_2
|
||||
if(module_state_3)
|
||||
. += module_state_3
|
||||
. += module_state_3
|
||||
|
||||
@@ -188,6 +188,10 @@
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
fullbright = TRUE
|
||||
else if (src.sight_mode & BORGANOMALOUS)
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = INVISIBILITY_SHADEKIN
|
||||
fullbright = TRUE
|
||||
else if (!seedarkness)
|
||||
src.sight &= ~SEE_MOBS
|
||||
src.sight &= ~SEE_TURFS
|
||||
|
||||
@@ -1304,6 +1304,20 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
// Function to directly drain power from the robot's cell, allows to set a minimum level beneath which
|
||||
// abilities can no longer be used
|
||||
/mob/living/silicon/robot/proc/use_direct_power(var/amount = 0, var/lower_limit = 0)
|
||||
// No cell inserted
|
||||
if(!cell)
|
||||
return FALSE
|
||||
|
||||
// Power cell does not have sufficient charge to remain above the power limit.
|
||||
if(cell.charge - (amount + lower_limit) <= 0)
|
||||
return FALSE
|
||||
|
||||
cell.charge -= amount
|
||||
return TRUE
|
||||
|
||||
/mob/living/silicon/robot/binarycheck()
|
||||
if(get_restraining_bolt())
|
||||
return FALSE
|
||||
@@ -1444,7 +1458,7 @@
|
||||
G.drop_item_nm()
|
||||
|
||||
/mob/living/silicon/robot/disable_spoiler_vision()
|
||||
if(sight_mode & (BORGMESON|BORGMATERIAL|BORGXRAY)) // Whyyyyyyyy have seperate defines.
|
||||
if(sight_mode & (BORGMESON|BORGMATERIAL|BORGXRAY|BORGANOMALOUS)) // Whyyyyyyyy have seperate defines.
|
||||
var/i = 0
|
||||
// Borg inventory code is very . . interesting and as such, unequiping a specific item requires jumping through some (for) loops.
|
||||
var/current_selection_index = get_selected_module() // Will be 0 if nothing is selected.
|
||||
@@ -1452,7 +1466,7 @@
|
||||
i++
|
||||
if(istype(thing, /obj/item/borg/sight))
|
||||
var/obj/item/borg/sight/S = thing
|
||||
if(S.sight_mode & (BORGMESON|BORGMATERIAL|BORGXRAY))
|
||||
if(S.sight_mode & (BORGMESON|BORGMATERIAL|BORGXRAY|BORGANOMALOUS))
|
||||
select_module(i)
|
||||
uneq_active()
|
||||
|
||||
@@ -1558,6 +1572,16 @@
|
||||
/mob/living/silicon/robot/proc/has_no_prod_upgrade(var/given_type)
|
||||
if(given_type == /obj/item/borg/upgrade/no_prod/toygun)
|
||||
return has_upgrade_module(/obj/item/weapon/gun/projectile/cyborgtoy)
|
||||
if(given_type == /obj/item/borg/upgrade/no_prod/vision_xray)
|
||||
return has_upgrade_module(/obj/item/borg/sight/xray)
|
||||
if(given_type == /obj/item/borg/upgrade/no_prod/vision_thermal)
|
||||
return has_upgrade_module(/obj/item/borg/sight/thermal)
|
||||
if(given_type == /obj/item/borg/upgrade/no_prod/vision_meson)
|
||||
return has_upgrade_module(/obj/item/borg/sight/meson)
|
||||
if(given_type == /obj/item/borg/upgrade/no_prod/vision_material)
|
||||
return has_upgrade_module(/obj/item/borg/sight/material)
|
||||
if(given_type == /obj/item/borg/upgrade/no_prod/vision_anomalous)
|
||||
return has_upgrade_module(/obj/item/borg/sight/anomalous)
|
||||
return null
|
||||
|
||||
/mob/living/silicon/robot/proc/has_upgrade(var/given_type)
|
||||
|
||||
@@ -76,9 +76,7 @@
|
||||
var/absorb_burn = burn*shield.shield_level
|
||||
var/cost = (absorb_brute+absorb_burn) * 25
|
||||
|
||||
cell.charge -= cost
|
||||
if(cell.charge <= 0)
|
||||
cell.charge = 0
|
||||
if(!use_direct_power(cost, 200))
|
||||
to_chat(src, "<span class='filter_warning'>[span_red("Your shield has overloaded!")]</span>")
|
||||
else
|
||||
brute -= absorb_brute
|
||||
@@ -123,9 +121,7 @@
|
||||
var/absorb_burn = burn*shield.shield_level
|
||||
var/cost = (absorb_brute+absorb_burn) * 25
|
||||
|
||||
cell.charge -= cost
|
||||
if(cell.charge <= 0)
|
||||
cell.charge = 0
|
||||
if(!use_direct_power(cost, 200))
|
||||
to_chat(src, "<span class='filter_warning'>[span_red("Your shield has overloaded!")]</span>")
|
||||
else
|
||||
brute -= absorb_brute
|
||||
|
||||
@@ -1175,7 +1175,7 @@
|
||||
if(client)
|
||||
if(a_intent == I_HELP || client.prefs.throwmode_loud)
|
||||
src.visible_message("<span class='notice'>[src] relaxes from their ready stance.</span>","<span class='notice'>You relax from your ready stance.</span>")
|
||||
if(src.throw_icon) //in case we don't have the HUD and we use the hotkey
|
||||
if(src.throw_icon && !issilicon(src)) //in case we don't have the HUD and we use the hotkey. Silicon use this for something else. Do not overwrite their HUD icon
|
||||
src.throw_icon.icon_state = "act_throw_off"
|
||||
|
||||
/mob/proc/throw_mode_on()
|
||||
@@ -1186,7 +1186,7 @@
|
||||
src.visible_message("<span class='warning'>[src] winds up to throw [get_active_hand()]!</span>","<span class='notice'>You wind up to throw [get_active_hand()].</span>")
|
||||
else
|
||||
src.visible_message("<span class='warning'>[src] looks ready to catch anything thrown at them!</span>","<span class='notice'>You get ready to catch anything thrown at you.</span>")
|
||||
if(src.throw_icon)
|
||||
if(src.throw_icon && !issilicon(src)) // Silicon use this for something else. Do not overwrite their HUD icon
|
||||
src.throw_icon.icon_state = "act_throw_on"
|
||||
|
||||
/mob/proc/isSynthetic()
|
||||
|
||||
@@ -76,26 +76,22 @@
|
||||
var/choice = tgui_alert(usr, "Load the Party Canon with?", "Change What?", list("Confetti","Banana Peel","Cream Pie"))
|
||||
if(!choice)
|
||||
return
|
||||
if(istype(usr,/mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
if(!R.use_direct_power(200, 400))
|
||||
to_chat(R, span_warning("Warning, low power detected. Aborting action."))
|
||||
return
|
||||
playsound(src, 'sound/effects/pop.ogg', 50, 0)
|
||||
switch(choice)
|
||||
if("Confetti")
|
||||
chambered = new /obj/item/weapon/grenade/confetti/party_ball
|
||||
to_chat(usr, span_blue("Confetti loaded."))
|
||||
if(istype(usr,/mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
R.cell.charge -= 200
|
||||
if("Banana Peel")
|
||||
chambered = new /obj/item/weapon/bananapeel
|
||||
to_chat(usr, span_blue("Banana peel loaded."))
|
||||
if(istype(usr,/mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
R.cell.charge -= 200
|
||||
if("Cream Pie")
|
||||
chambered = new /obj/item/weapon/reagent_containers/food/snacks/pie
|
||||
to_chat(usr, span_blue("Banana cream pie loaded."))
|
||||
if(istype(usr,/mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
R.cell.charge -= 200
|
||||
else
|
||||
to_chat(usr, span_red("The [src] is already loaded!"))
|
||||
|
||||
|
||||
@@ -520,6 +520,31 @@
|
||||
id = "borg_hound_cyborg_blaster"
|
||||
build_path = /obj/item/borg/upgrade/no_prod/toygun
|
||||
|
||||
/datum/design/item/prosfab/robot_upgrade/no_prod/vision_xray
|
||||
name = "X-ray vision"
|
||||
id = "borg_hound_vision_xray"
|
||||
build_path = /obj/item/borg/upgrade/no_prod/vision_xray
|
||||
|
||||
/datum/design/item/prosfab/robot_upgrade/no_prod/vision_thermal
|
||||
name = "Thermal vision"
|
||||
id = "borg_hound_vision_thermal"
|
||||
build_path = /obj/item/borg/upgrade/no_prod/vision_thermal
|
||||
|
||||
/datum/design/item/prosfab/robot_upgrade/no_prod/vision_meson
|
||||
name = "Meson vision"
|
||||
id = "borg_hound_vision_meson"
|
||||
build_path = /obj/item/borg/upgrade/no_prod/vision_meson
|
||||
|
||||
/datum/design/item/prosfab/robot_upgrade/no_prod/vision_material
|
||||
name = "Material vision"
|
||||
id = "borg_hound_vision_material"
|
||||
build_path = /obj/item/borg/upgrade/no_prod/vision_material
|
||||
|
||||
/datum/design/item/prosfab/robot_upgrade/no_prod/vision_anomalous
|
||||
name = "Anomalous vision"
|
||||
id = "borg_hound_vision_anomalous"
|
||||
build_path = /obj/item/borg/upgrade/no_prod/vision_anomalous
|
||||
|
||||
// Synthmorph Bags.
|
||||
|
||||
/datum/design/item/prosfab/synthmorphbag
|
||||
|
||||
Reference in New Issue
Block a user