mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
guh (#22566)
This commit is contained in:
@@ -99,18 +99,17 @@
|
|||||||
|
|
||||||
return txt
|
return txt
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/proc/is_ranged()//add a distance restricted equipment. Why not?
|
|
||||||
return range & MECHA_RANGED
|
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/proc/is_melee()
|
|
||||||
return range & MECHA_MELEE
|
|
||||||
|
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/proc/action_checks(atom/target)
|
/obj/item/mecha_parts/mecha_equipment/proc/action_checks(atom/target)
|
||||||
if(!target)
|
if(!target)
|
||||||
return FALSE
|
return FALSE
|
||||||
if(!chassis)
|
if(!chassis)
|
||||||
return FALSE
|
return FALSE
|
||||||
|
if(chassis.Adjacent(target))
|
||||||
|
if(!(range & MECHA_MELEE))
|
||||||
|
chassis.default_melee_attack(target)
|
||||||
|
return FALSE
|
||||||
|
else if(!(range & MECHA_RANGED))
|
||||||
|
return FALSE
|
||||||
if(!equip_ready)
|
if(!equip_ready)
|
||||||
return FALSE
|
return FALSE
|
||||||
if(energy_drain && !chassis.has_charge(energy_drain))
|
if(energy_drain && !chassis.has_charge(energy_drain))
|
||||||
|
|||||||
@@ -49,8 +49,6 @@
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/medical/sleeper/action(mob/living/carbon/target)
|
/obj/item/mecha_parts/mecha_equipment/medical/sleeper/action(mob/living/carbon/target)
|
||||||
if(!action_checks(target))
|
|
||||||
return
|
|
||||||
if(!istype(target))
|
if(!istype(target))
|
||||||
return
|
return
|
||||||
if(!patient_insertion_check(target))
|
if(!patient_insertion_check(target))
|
||||||
@@ -288,8 +286,6 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/action(atom/movable/target)
|
/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/action(atom/movable/target)
|
||||||
if(!action_checks(target))
|
|
||||||
return
|
|
||||||
if(istype(target, /obj/item/reagent_containers/syringe))
|
if(istype(target, /obj/item/reagent_containers/syringe))
|
||||||
return load_syringe(target)
|
return load_syringe(target)
|
||||||
if(istype(target, /obj/item/storage))//Loads syringes from boxes
|
if(istype(target, /obj/item/storage))//Loads syringes from boxes
|
||||||
|
|||||||
@@ -22,11 +22,12 @@
|
|||||||
. = ..()
|
. = ..()
|
||||||
AddComponent(/datum/component/butchering, 50, 100)
|
AddComponent(/datum/component/butchering, 50, 100)
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/drill/action(atom/target)
|
/obj/item/mecha_parts/mecha_equipment/drill/action_checks(atom/target)
|
||||||
if(!action_checks(target))
|
|
||||||
return
|
|
||||||
if(isspaceturf(target))
|
if(isspaceturf(target))
|
||||||
return
|
return FALSE
|
||||||
|
return ..()
|
||||||
|
|
||||||
|
/obj/item/mecha_parts/mecha_equipment/drill/action(atom/target)
|
||||||
if(isobj(target))
|
if(isobj(target))
|
||||||
var/obj/target_obj = target
|
var/obj/target_obj = target
|
||||||
if(target_obj.resistance_flags & UNACIDABLE)
|
if(target_obj.resistance_flags & UNACIDABLE)
|
||||||
|
|||||||
@@ -12,9 +12,14 @@
|
|||||||
energy_drain = 1000
|
energy_drain = 1000
|
||||||
range = MECHA_RANGED
|
range = MECHA_RANGED
|
||||||
|
|
||||||
|
/obj/item/mecha_parts/mecha_equipment/teleporter/action_checks(atom/target)
|
||||||
|
var/area/start_area = get_area(chassis)
|
||||||
|
var/area/end_area = get_area(target)
|
||||||
|
if((start_area.area_flags|end_area.area_flags) & NOTELEPORT)
|
||||||
|
return FALSE
|
||||||
|
return ..()
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/teleporter/action(atom/target)
|
/obj/item/mecha_parts/mecha_equipment/teleporter/action(atom/target)
|
||||||
if(!action_checks(target) || is_centcom_level(loc.z))
|
|
||||||
return
|
|
||||||
var/turf/T = get_turf(target)
|
var/turf/T = get_turf(target)
|
||||||
if(T)
|
if(T)
|
||||||
do_teleport(chassis, T, 4, channel = TELEPORT_CHANNEL_BLUESPACE)
|
do_teleport(chassis, T, 4, channel = TELEPORT_CHANNEL_BLUESPACE)
|
||||||
@@ -32,10 +37,14 @@
|
|||||||
energy_drain = 300
|
energy_drain = 300
|
||||||
range = MECHA_RANGED
|
range = MECHA_RANGED
|
||||||
|
|
||||||
|
/obj/item/mecha_parts/mecha_equipment/wormhole_generator/action_checks(atom/target)
|
||||||
|
var/area/start_area = get_area(chassis)
|
||||||
|
var/area/end_area = get_area(target)
|
||||||
|
if((start_area.area_flags|end_area.area_flags) & NOTELEPORT)
|
||||||
|
return FALSE
|
||||||
|
return ..()
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/wormhole_generator/action(atom/target)
|
/obj/item/mecha_parts/mecha_equipment/wormhole_generator/action(atom/target)
|
||||||
if(!action_checks(target) || is_centcom_level(loc.z))
|
|
||||||
return
|
|
||||||
var/list/theareas = get_areas_in_range(100, chassis)
|
var/list/theareas = get_areas_in_range(100, chassis)
|
||||||
if(!theareas.len)
|
if(!theareas.len)
|
||||||
return
|
return
|
||||||
@@ -82,8 +91,6 @@
|
|||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/gravcatapult/action(atom/movable/target, mob/living/user, params)
|
/obj/item/mecha_parts/mecha_equipment/gravcatapult/action(atom/movable/target, mob/living/user, params)
|
||||||
if(!action_checks(target))
|
|
||||||
return
|
|
||||||
var/list/modifiers = params2list(params)
|
var/list/modifiers = params2list(params)
|
||||||
if(modifiers[RIGHT_CLICK])
|
if(modifiers[RIGHT_CLICK])
|
||||||
if(locked)
|
if(locked)
|
||||||
|
|||||||
@@ -51,8 +51,6 @@
|
|||||||
tool_behaviour = 0
|
tool_behaviour = 0
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/action(atom/target, mob/living/user, params)
|
/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/action(atom/target, mob/living/user, params)
|
||||||
if(!action_checks(target))
|
|
||||||
return
|
|
||||||
if(!cargo_holder)
|
if(!cargo_holder)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -133,8 +131,6 @@
|
|||||||
real_clamp = TRUE
|
real_clamp = TRUE
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/kill/action(atom/target, mob/living/user, params)
|
/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/kill/action(atom/target, mob/living/user, params)
|
||||||
if(!action_checks(target))
|
|
||||||
return
|
|
||||||
if(!cargo_holder)
|
if(!cargo_holder)
|
||||||
return
|
return
|
||||||
if(isobj(target))
|
if(isobj(target))
|
||||||
@@ -220,9 +216,6 @@
|
|||||||
reagents.add_reagent(/datum/reagent/firefighting_foam, 1000)
|
reagents.add_reagent(/datum/reagent/firefighting_foam, 1000)
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/extinguisher/action(atom/target) //copypasted from extinguisher. TODO: Rewrite from scratch.
|
/obj/item/mecha_parts/mecha_equipment/extinguisher/action(atom/target) //copypasted from extinguisher. TODO: Rewrite from scratch.
|
||||||
if(!action_checks(target))
|
|
||||||
return
|
|
||||||
|
|
||||||
if(istype(target, /obj/structure/reagent_dispensers/foamtank) && get_dist(chassis,target) <= 1)
|
if(istype(target, /obj/structure/reagent_dispensers/foamtank) && get_dist(chassis,target) <= 1)
|
||||||
var/obj/structure/reagent_dispensers/WT = target
|
var/obj/structure/reagent_dispensers/WT = target
|
||||||
WT.reagents.trans_to(src, 1000)
|
WT.reagents.trans_to(src, 1000)
|
||||||
@@ -494,8 +487,6 @@
|
|||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/cable_layer/action(obj/item/stack/cable_coil/target)
|
/obj/item/mecha_parts/mecha_equipment/cable_layer/action(obj/item/stack/cable_coil/target)
|
||||||
if(!action_checks(target))
|
|
||||||
return
|
|
||||||
if(istype(target) && target.amount)
|
if(istype(target) && target.amount)
|
||||||
var/cur_amount = cable? cable.amount : 0
|
var/cur_amount = cable? cable.amount : 0
|
||||||
var/to_load = max(max_cable - cur_amount,0)
|
var/to_load = max(max_cable - cur_amount,0)
|
||||||
|
|||||||
@@ -72,9 +72,6 @@
|
|||||||
|
|
||||||
//Melee weapon attacks are a little different in that they'll override the standard melee attack
|
//Melee weapon attacks are a little different in that they'll override the standard melee attack
|
||||||
/obj/item/mecha_parts/mecha_equipment/melee_weapon/action(atom/target, mob/living/user, params)
|
/obj/item/mecha_parts/mecha_equipment/melee_weapon/action(atom/target, mob/living/user, params)
|
||||||
if(!action_checks(target))
|
|
||||||
return 0
|
|
||||||
|
|
||||||
var/turf/curloc = get_turf(chassis)
|
var/turf/curloc = get_turf(chassis)
|
||||||
var/turf/targloc = get_turf(target)
|
var/turf/targloc = get_turf(target)
|
||||||
if (!targloc || !istype(targloc) || !curloc)
|
if (!targloc || !istype(targloc) || !curloc)
|
||||||
|
|||||||
@@ -33,9 +33,6 @@
|
|||||||
return projectiles_per_shot
|
return projectiles_per_shot
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/weapon/action(atom/target, mob/living/user, params)
|
/obj/item/mecha_parts/mecha_equipment/weapon/action(atom/target, mob/living/user, params)
|
||||||
if(!action_checks(target))
|
|
||||||
return 0
|
|
||||||
|
|
||||||
var/turf/curloc = get_turf(chassis)
|
var/turf/curloc = get_turf(chassis)
|
||||||
var/turf/targloc = get_turf(target)
|
var/turf/targloc = get_turf(target)
|
||||||
if (!targloc || !istype(targloc) || !curloc)
|
if (!targloc || !istype(targloc) || !curloc)
|
||||||
@@ -240,8 +237,6 @@
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/weapon/honker/action(target, params)
|
/obj/item/mecha_parts/mecha_equipment/weapon/honker/action(target, params)
|
||||||
if(!action_checks(target))
|
|
||||||
return
|
|
||||||
playsound(chassis, 'sound/items/airhorn.ogg', 100, 1)
|
playsound(chassis, 'sound/items/airhorn.ogg', 100, 1)
|
||||||
chassis.occupant_message("<font color='red' size='5'>HONK</font>")
|
chassis.occupant_message("<font color='red' size='5'>HONK</font>")
|
||||||
for(var/mob/living/carbon/M in ohearers(6, chassis))
|
for(var/mob/living/carbon/M in ohearers(6, chassis))
|
||||||
@@ -452,8 +447,6 @@
|
|||||||
var/diags_first = FALSE
|
var/diags_first = FALSE
|
||||||
|
|
||||||
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/action(target)
|
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/action(target)
|
||||||
if(!action_checks(target))
|
|
||||||
return
|
|
||||||
var/obj/O = new projectile(chassis.loc)
|
var/obj/O = new projectile(chassis.loc)
|
||||||
playsound(chassis, fire_sound, 50, 1)
|
playsound(chassis, fire_sound, 50, 1)
|
||||||
log_message("Launched a [O.name] from [name], targeting [target].", LOG_MECHA)
|
log_message("Launched a [O.name] from [name], targeting [target].", LOG_MECHA)
|
||||||
|
|||||||
@@ -547,11 +547,11 @@
|
|||||||
for(var/obj/item/mecha_parts/mecha_equipment/weapon/W in equipment)
|
for(var/obj/item/mecha_parts/mecha_equipment/weapon/W in equipment)
|
||||||
if(!W.equip_ready && (W.equip_cooldown < MECHA_MAX_COOLDOWN))
|
if(!W.equip_ready && (W.equip_cooldown < MECHA_MAX_COOLDOWN))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(Adjacent(target) && !selected?.is_melee())
|
if(!selected && Adjacent(target))
|
||||||
default_melee_attack(target)
|
default_melee_attack(target)
|
||||||
return
|
return
|
||||||
if(selected?.action(target, user, params))
|
if(selected.action_checks(target) && selected.action(target, user, params))
|
||||||
selected.start_cooldown()
|
selected.start_cooldown()
|
||||||
|
|
||||||
/obj/mecha/proc/default_melee_attack(atom/target)
|
/obj/mecha/proc/default_melee_attack(atom/target)
|
||||||
|
|||||||
@@ -163,7 +163,7 @@
|
|||||||
var/list/possible_weapons = get_mecha_equip_by_flag(MECHA_RANGED)
|
var/list/possible_weapons = get_mecha_equip_by_flag(MECHA_RANGED)
|
||||||
if(possible_weapons.len)
|
if(possible_weapons.len)
|
||||||
var/obj/item/mecha_parts/mecha_equipment/ME = pick(possible_weapons) //so we don't favor mecha.equipment[1] forever
|
var/obj/item/mecha_parts/mecha_equipment/ME = pick(possible_weapons) //so we don't favor mecha.equipment[1] forever
|
||||||
if(ME.action(A))
|
if(ME.action_checks(A) && ME.action(A))
|
||||||
ME.start_cooldown()
|
ME.start_cooldown()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user