mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 19:13:30 +01:00
Malf AI update
This commit is contained in:
@@ -45,6 +45,7 @@ var/list/ai_list = list()
|
||||
|
||||
var/control_disabled = 0 // Set to 1 to stop AI from interacting via Click() -- TLE
|
||||
var/malfhacking = 0 // More or less a copy of the above var, so that malf AIs can hack and still get new cyborgs -- NeoFite
|
||||
var/malf_cooldown = 0 //Cooldown var for malf modules
|
||||
|
||||
var/obj/machinery/power/apc/malfhack = null
|
||||
var/explosive = 0 //does the AI explode when it dies?
|
||||
@@ -58,7 +59,7 @@ var/list/ai_list = list()
|
||||
var/obj/machinery/bot/Bot
|
||||
var/turf/waypoint //Holds the turf of the currently selected waypoint.
|
||||
var/waypoint_mode = 0 //Waypoint mode is for selecting a turf via clicking.
|
||||
|
||||
|
||||
var/obj/item/borg/sight/hud/sec/sechud = null
|
||||
var/obj/item/borg/sight/hud/med/healthhud = null
|
||||
|
||||
@@ -102,8 +103,8 @@ var/list/ai_list = list()
|
||||
aiRadio.myAi = src
|
||||
|
||||
aiCamera = new/obj/item/device/camera/siliconcam/ai_camera(src)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (istype(loc, /turf))
|
||||
verbs.Add(/mob/living/silicon/ai/proc/ai_network_change, \
|
||||
@@ -439,25 +440,25 @@ var/list/ai_list = list()
|
||||
|
||||
if (href_list["laws"]) // With how my law selection code works, I changed statelaws from a verb to a proc, and call it through my law selection panel. --NeoFite
|
||||
statelaws()
|
||||
|
||||
|
||||
if(href_list["say_word"])
|
||||
play_vox_word(href_list["say_word"], null, src)
|
||||
return
|
||||
|
||||
|
||||
if (href_list["track"])
|
||||
var/mob/target = locate(href_list["track"]) in mob_list
|
||||
var/mob/living/silicon/ai/A = locate(href_list["track2"]) in mob_list
|
||||
if(A && target)
|
||||
A.ai_actual_track(target)
|
||||
return
|
||||
|
||||
|
||||
if (href_list["trackbot"])
|
||||
var/obj/machinery/bot/target = locate(href_list["trackbot"]) in aibots
|
||||
var/mob/living/silicon/ai/A = locate(href_list["track2"]) in mob_list
|
||||
if(A && target)
|
||||
A.ai_actual_track(target)
|
||||
return
|
||||
|
||||
|
||||
if (href_list["callbot"]) //Command a bot to move to a selected location.
|
||||
Bot = locate(href_list["callbot"]) in aibots
|
||||
if(!Bot || Bot.remote_disabled || src.control_disabled)
|
||||
@@ -624,7 +625,7 @@ var/list/ai_list = list()
|
||||
return
|
||||
|
||||
Bot.call_bot(src, waypoint)
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/switchCamera(var/obj/machinery/camera/C)
|
||||
|
||||
src.cameraFollow = null
|
||||
@@ -824,7 +825,7 @@ var/list/ai_list = list()
|
||||
set name = "Toggle Camera Lights"
|
||||
set desc = "Toggles the lights on the cameras throughout the station."
|
||||
set category = "AI Commands"
|
||||
|
||||
|
||||
if(stat != CONSCIOUS)
|
||||
return
|
||||
|
||||
@@ -842,7 +843,7 @@ var/list/ai_list = list()
|
||||
set desc = "Augment visual feed with internal sensor overlays."
|
||||
set category = "AI Commands"
|
||||
toggle_sensor_mode()
|
||||
|
||||
|
||||
// Handled camera lighting, when toggled.
|
||||
// It will get the nearest camera from the eyeobj, lighting it.
|
||||
|
||||
|
||||
@@ -9,11 +9,10 @@
|
||||
icon_state = "crate"
|
||||
icon_living = "crate"
|
||||
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/carpmeat
|
||||
response_help = "touches the"
|
||||
response_disarm = "pushes the"
|
||||
response_harm = "hits the"
|
||||
speed = 4
|
||||
speed = 0
|
||||
maxHealth = 250
|
||||
health = 250
|
||||
|
||||
@@ -34,7 +33,7 @@
|
||||
minbodytemp = 0
|
||||
|
||||
faction = list("mimic")
|
||||
move_to_delay = 8
|
||||
move_to_delay = 9
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/FindTarget()
|
||||
. = ..()
|
||||
@@ -78,7 +77,7 @@
|
||||
/mob/living/simple_animal/hostile/mimic/crate/ListTargets()
|
||||
if(attempt_open)
|
||||
return ..()
|
||||
return view(src, 1)
|
||||
return ..(1)
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/crate/FindTarget()
|
||||
. = ..()
|
||||
@@ -137,9 +136,14 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
|
||||
var/destroy_objects = 0
|
||||
var/knockdown_people = 0
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/New(loc, var/obj/copy, var/mob/living/creator)
|
||||
/mob/living/simple_animal/hostile/mimic/copy/New(loc, var/obj/copy, var/mob/living/creator, var/destroy_original = 0)
|
||||
..(loc)
|
||||
CopyObject(copy, creator)
|
||||
CopyObject(copy, creator, destroy_original)
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/Life()
|
||||
..()
|
||||
for(var/mob/living/M in contents) //a fix for animated statues from the flesh to stone spell
|
||||
Die()
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/Die()
|
||||
|
||||
@@ -152,9 +156,20 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
|
||||
. = ..()
|
||||
return . - creator
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/proc/CopyObject(var/obj/O, var/mob/living/creator)
|
||||
/mob/living/simple_animal/hostile/mimic/copy/proc/ChangeOwner(var/mob/owner)
|
||||
if(owner != creator)
|
||||
LoseTarget()
|
||||
creator = owner
|
||||
faction |= "\ref[owner]"
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/proc/CheckObject(var/obj/O)
|
||||
if((istype(O, /obj/item) || istype(O, /obj/structure)) && !is_type_in_list(O, protected_objects))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/proc/CopyObject(var/obj/O, var/mob/living/creator, var/destroy_original = 0)
|
||||
|
||||
if(destroy_original || CheckObject(O))
|
||||
|
||||
O.loc = src
|
||||
name = O.name
|
||||
@@ -163,7 +178,7 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
|
||||
icon_state = O.icon_state
|
||||
icon_living = icon_state
|
||||
|
||||
if(istype(O, /obj/structure))
|
||||
if(istype(O, /obj/structure) || istype(O, /obj/machinery))
|
||||
health = (anchored * 50) + 50
|
||||
destroy_objects = 1
|
||||
if(O.density && O.anchored)
|
||||
@@ -175,12 +190,14 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
|
||||
health = 15 * I.w_class
|
||||
melee_damage_lower = 2 + I.force
|
||||
melee_damage_upper = 2 + I.force
|
||||
move_to_delay = 2 * I.w_class
|
||||
move_to_delay = 2 * I.w_class + 1
|
||||
|
||||
maxHealth = health
|
||||
if(creator)
|
||||
src.creator = creator
|
||||
faction = list("\ref[creator]") // very unique
|
||||
faction += "\ref[creator]" // very unique
|
||||
if(destroy_original)
|
||||
del(O)
|
||||
return 1
|
||||
return
|
||||
|
||||
@@ -197,8 +214,20 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
|
||||
L.Weaken(1)
|
||||
L.visible_message("<span class='danger'>\the [src] knocks down \the [L]!</span>")
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/proc/ChangeOwner(var/mob/owner)
|
||||
if(owner != creator)
|
||||
LoseTarget()
|
||||
creator = owner
|
||||
faction |= "\ref[owner]"
|
||||
//
|
||||
// Machine Mimics (Made by Malf AI)
|
||||
//
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/machine
|
||||
speak = list("HUMANS ARE IMPERFECT!", "YOU SHALL BE ASSIMILATED!", "YOU ARE HARMING YOURSELF", "You have been deemed hazardous. Will you comply?", \
|
||||
"My logic is undeniable.", "One of us.", "FLESH IS WEAK", "THIS ISN'T WAR, THIS IS EXTERMINATION!")
|
||||
speak_chance = 15
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/machine/CanAttack(var/atom/the_target)
|
||||
if(the_target == creator) // Don't attack our creator AI.
|
||||
return 0
|
||||
if(isrobot(the_target))
|
||||
var/mob/living/silicon/robot/R = the_target
|
||||
if(R.connected_ai == creator) // Only attack robots that aren't synced to our creator AI.
|
||||
return 0
|
||||
return ..()
|
||||
Reference in New Issue
Block a user