Skip to content

Commit

Permalink
[MIRROR] Basic drones [MDB IGNORE] (#24507) (#225)
Browse files Browse the repository at this point in the history
* Basic drones

* Diffs

* Diffs

* Modular

* Modular

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: lizardqueenlexi <[email protected]>
Co-authored-by: Giz <[email protected]>
  • Loading branch information
4 people authored Oct 23, 2023
1 parent d7976cd commit 80115a0
Show file tree
Hide file tree
Showing 38 changed files with 265 additions and 319 deletions.
2 changes: 1 addition & 1 deletion _maps/shuttles/emergency_bar.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
/turf/open/floor/iron/grimy,
/area/shuttle/escape)
"aX" = (
/mob/living/simple_animal/drone/snowflake/bardrone,
/mob/living/basic/drone/snowflake/bardrone,
/obj/effect/turf_decal/tile/bar/opposingcorners,
/turf/open/floor/iron,
/area/shuttle/escape)
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/emergency_cruise.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@
/turf/open/floor/wood,
/area/shuttle/escape)
"xb" = (
/mob/living/simple_animal/drone/snowflake/bardrone,
/mob/living/basic/drone/snowflake/bardrone,
/turf/open/floor/wood,
/area/shuttle/escape)
"xf" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/emergency_rollerdome.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
/turf/open/floor/eighties,
/area/shuttle/escape)
"Zf" = (
/mob/living/simple_animal/drone/snowflake/bardrone,
/mob/living/basic/drone/snowflake/bardrone,
/turf/open/floor/wood/parquet,
/area/shuttle/escape)
"Zo" = (
Expand Down
4 changes: 3 additions & 1 deletion code/__DEFINES/dcs/signals/signals_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@
#define COMSIG_ITEM_PICKUP "item_pickup"
///from base of obj/item/on_outfit_equip(): (mob/equipper, visuals_only, slot)
#define COMSIG_ITEM_EQUIPPED_AS_OUTFIT "item_equip_as_outfit"
///from base of datum/storage/attempt_insert(): ()
#define COMSIG_ITEM_STORED "item_stored"

///from base of obj/item/apply_fantasy_bonuses(): (bonus)
#define COMSIG_ITEM_APPLY_FANTASY_BONUSES "item_apply_fantasy_bonuses"
Expand Down Expand Up @@ -250,7 +252,7 @@

/// Called on component/uplink/OnAttackBy(..)
#define COMSIG_ITEM_ATTEMPT_TC_REIMBURSE "item_attempt_tc_reimburse"
///Called when a holoparasite/guardiancreator is used.
///Called when a holoparasite/guardiancreator is used.
#define COMSIG_TRAITOR_ITEM_USED(type) "traitor_item_used_[type]"

// /obj/item/clothing signals
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ GLOBAL_LIST_INIT(turfs_pass_meteor, typecacheof(list(

#define isslime(A) (istype(A, /mob/living/simple_animal/slime))

#define isdrone(A) (istype(A, /mob/living/simple_animal/drone))
#define isdrone(A) (istype(A, /mob/living/basic/drone))

#define iscat(A) (istype(A, /mob/living/simple_animal/pet/cat))

Expand Down
6 changes: 3 additions & 3 deletions code/_globalvars/phobias.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ GLOBAL_LIST_INIT(phobia_mobs, list(
/mob/living/simple_animal/parrot,
)),
"conspiracies" = typecacheof(list(
/mob/living/simple_animal/bot/secbot,
/mob/living/simple_animal/drone,
/mob/living/basic/drone,
/mob/living/basic/pet/penguin,
/mob/living/simple_animal/bot/secbot,
)),
"doctors" = typecacheof(list(/mob/living/simple_animal/bot/medbot)),
"heresy" = typecacheof(list(
Expand All @@ -79,10 +79,10 @@ GLOBAL_LIST_INIT(phobia_mobs, list(
)),
"lizards" = typecacheof(list(/mob/living/basic/lizard)),
"robots" = typecacheof(list(
/mob/living/basic/drone,
/mob/living/silicon/ai,
/mob/living/silicon/robot,
/mob/living/simple_animal/bot,
/mob/living/simple_animal/drone,
)),
"security" = typecacheof(list(/mob/living/simple_animal/bot/secbot)),
"spiders" = typecacheof(list(/mob/living/basic/spider/giant)),
Expand Down
20 changes: 9 additions & 11 deletions code/_onclick/hud/drones.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,17 @@
/datum/hud/dextrous/drone/persistent_inventory_update()
if(!mymob)
return
var/mob/living/simple_animal/drone/D = mymob
var/mob/living/basic/drone/drone = mymob

if(hud_shown)
if(D.internal_storage)
D.internal_storage.screen_loc = ui_drone_storage
D.client.screen += D.internal_storage
if(D.head)
D.head.screen_loc = ui_drone_head
D.client.screen += D.head
if(!isnull(drone.internal_storage))
drone.internal_storage.screen_loc = ui_drone_storage
drone.client.screen += drone.internal_storage
if(!isnull(drone.head))
drone.head.screen_loc = ui_drone_head
drone.client.screen += drone.head
else
if(D.internal_storage)
D.internal_storage.screen_loc = null
if(D.head)
D.head.screen_loc = null
drone.internal_storage?.screen_loc = null
drone.head?.screen_loc = null

..()
8 changes: 4 additions & 4 deletions code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -263,22 +263,22 @@
Drones
*/

/mob/living/simple_animal/drone/resolve_unarmed_attack(atom/attack_target, proximity_flag, list/modifiers)
/mob/living/basic/drone/resolve_unarmed_attack(atom/attack_target, proximity_flag, list/modifiers)
attack_target.attack_drone(src, modifiers)

/mob/living/simple_animal/drone/resolve_right_click_attack(atom/target, list/modifiers)
/mob/living/basic/drone/resolve_right_click_attack(atom/target, list/modifiers)
return target.attack_drone_secondary(src, modifiers)

/// Defaults to attack_hand. Override it when you don't want drones to do same stuff as humans.
/atom/proc/attack_drone(mob/living/simple_animal/drone/user, list/modifiers)
/atom/proc/attack_drone(mob/living/basic/drone/user, list/modifiers)
attack_hand(user, modifiers)

/**
* Called when a maintenance drone right clicks an atom.
* Defaults to attack_hand_secondary.
* When overriding it, remember that it ought to return a SECONDARY_ATTACK_* value.
*/
/atom/proc/attack_drone_secondary(mob/living/simple_animal/drone/user, list/modifiers)
/atom/proc/attack_drone_secondary(mob/living/basic/drone/user, list/modifiers)
return attack_hand_secondary(user, modifiers)

/*
Expand Down
2 changes: 2 additions & 0 deletions code/datums/components/holderloving.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
COMSIG_ITEM_EQUIPPED,
COMSIG_ATOM_ENTERED,
COMSIG_ATOM_EXITED,
COMSIG_ITEM_STORED,
), PROC_REF(check_my_loc))

/datum/component/holderloving/UnregisterFromParent()
Expand All @@ -46,6 +47,7 @@
COMSIG_ITEM_EQUIPPED,
COMSIG_ATOM_ENTERED,
COMSIG_ATOM_EXITED,
COMSIG_ITEM_STORED,
))

/datum/component/holderloving/PostTransfer()
Expand Down
4 changes: 2 additions & 2 deletions code/datums/saymode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@

/datum/saymode/binary/handle_message(mob/living/user, message, datum/language/language)
if(isdrone(user))
var/mob/living/simple_animal/drone/D = user
D.drone_chat(message)
var/mob/living/basic/drone/drone_user = user
drone_user.drone_chat(message)
return FALSE
if(user.binarycheck())
user.robot_talk(message)
Expand Down
1 change: 1 addition & 0 deletions code/datums/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
to_insert.forceMove(resolve_location)
item_insertion_feedback(user, to_insert, override)
resolve_location.update_appearance()
SEND_SIGNAL(to_insert, COMSIG_ITEM_STORED)
return TRUE

/**
Expand Down
8 changes: 4 additions & 4 deletions code/datums/wires/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@
/datum/wires/airlock/interactable(mob/user)
if(!..())
return FALSE
var/obj/machinery/door/airlock/A = holder
if(!issilicon(user) && A.isElectrified())
var/obj/machinery/door/airlock/airlock = holder
if(!issilicon(user) && !isdrone(user) && airlock.isElectrified())
var/mob/living/carbon/carbon_user = user
if (!istype(carbon_user) || carbon_user.should_electrocute(src))
return FALSE
if(A.is_secure())
if(airlock.is_secure())
return FALSE
if(A.panel_open)
if(airlock.panel_open)
return TRUE

/datum/wires/airlock/get_status()
Expand Down
14 changes: 7 additions & 7 deletions code/game/machinery/computer/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@
data["cyborgs"] += list(cyborg_data)

data["drones"] = list()
for(var/mob/living/simple_animal/drone/D in GLOB.drones_list)
if(D.hacked)
for(var/mob/living/basic/drone/drone in GLOB.drones_list)
if(drone.hacked)
continue
if(!is_valid_z_level(current_turf, get_turf(D)))
if(!is_valid_z_level(current_turf, get_turf(drone)))
continue
var/list/drone_data = list(
name = D.name,
status = D.stat,
ref = REF(D)
name = drone.name,
status = drone.stat,
ref = REF(drone)
)
data["drones"] += list(drone_data)

Expand Down Expand Up @@ -148,7 +148,7 @@

if("killdrone")
if(allowed(usr))
var/mob/living/simple_animal/drone/drone = locate(params["ref"]) in GLOB.mob_list
var/mob/living/basic/drone/drone = locate(params["ref"]) in GLOB.mob_list
if(drone.hacked)
to_chat(usr, span_danger("ERROR: [drone] is not responding to external commands."))
else
Expand Down
4 changes: 2 additions & 2 deletions code/modules/admin/verbs/secrets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller)
var/spawnpoint = pick(GLOB.blobstart)
var/list/mob/dead/observer/candidates
var/mob/dead/observer/chosen_candidate
var/mob/living/simple_animal/drone/nerd
var/mob/living/basic/drone/nerd
var/teamsize

teamsize = input(usr, "How many drones?", "N.E.R.D. team size", 2) as num|null
Expand All @@ -570,7 +570,7 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller)
while(length(candidates) && teamsize)
chosen_candidate = pick(candidates)
candidates -= chosen_candidate
nerd = new /mob/living/simple_animal/drone/classic(spawnpoint)
nerd = new /mob/living/basic/drone/classic(spawnpoint)
nerd.key = chosen_candidate.key
nerd.log_message("has been selected as a Nanotrasen emergency response drone.", LOG_GAME)
teamsize--
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/chameleon/chameleon_drone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
if(!IsAvailable(feedback = TRUE))
return FALSE

var/mob/living/simple_animal/drone/droney = owner
var/mob/living/basic/drone/droney = owner

// The drone unEquip() proc sets head to null after dropping
// an item, so we need to keep a reference to our old headgear
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/basic/basic_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@
damage = rand(20, 35)
return attack_threshold_check(damage)

/mob/living/basic/attack_drone(mob/living/simple_animal/drone/attacking_drone)
/mob/living/basic/attack_drone(mob/living/basic/drone/attacking_drone)
if(attacking_drone.combat_mode) //No kicking dogs even as a rogue drone. Use a weapon.
return
return ..()

/mob/living/basic/attack_drone_secondary(mob/living/simple_animal/drone/attacking_drone)
/mob/living/basic/attack_drone_secondary(mob/living/basic/drone/attacking_drone)
if(attacking_drone.combat_mode)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
return ..()
Expand Down
Loading

0 comments on commit 80115a0

Please sign in to comment.