mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-12 00:27:31 +01:00
Merge pull request #925 from Giacomand/blob_vamp
Blob Gamemode Revamp Blob gamemode is back and better than ever. The blob is selected from be_alien candidates and is controled like a real time strategy game.
This commit is contained in:
@@ -103,7 +103,6 @@ var/global/floorIsLava = 0
|
||||
body += "<A href='?_src_=holder;makeai=\ref[M]'>Make AI</A> | "
|
||||
body += "<A href='?_src_=holder;makerobot=\ref[M]'>Make Robot</A> | "
|
||||
body += "<A href='?_src_=holder;makealien=\ref[M]'>Make Alien</A> | "
|
||||
body += "<A href='?_src_=holder;makeblob=\ref[M]'>Make Blob Fragment</A> | "
|
||||
body += "<A href='?_src_=holder;makeslime=\ref[M]'>Make Slime</A> "
|
||||
|
||||
//Simple Animals
|
||||
@@ -467,7 +466,6 @@ var/global/floorIsLava = 0
|
||||
<A href='?src=\ref[src];secretsfun=eagles'>Egalitarian Station Mode</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=blackout'>Break all lights</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=whiteout'>Fix all lights</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=friendai'>Best Friend AI</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=floorlava'>The floor is lava! (DANGEROUS: extremely lame)</A><BR>
|
||||
"}
|
||||
|
||||
|
||||
@@ -231,9 +231,6 @@
|
||||
else if(href_list["call_shuttle"])
|
||||
if(!check_rights(R_ADMIN)) return
|
||||
|
||||
if( ticker.mode.name == "blob" )
|
||||
alert("You can't call the shuttle during blob!")
|
||||
return
|
||||
|
||||
switch(href_list["call_shuttle"])
|
||||
if("1")
|
||||
@@ -1046,18 +1043,6 @@
|
||||
message_admins("\blue [key_name_admin(usr)] attempting to corgize [key_name_admin(H)]", 1)
|
||||
H.corgize()
|
||||
|
||||
else if(href_list["makeblob"])
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["makeblob"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human"
|
||||
return
|
||||
|
||||
log_admin("[key_name(usr)] attempting to blobize [key_name(H)]")
|
||||
message_admins("\blue [key_name_admin(usr)] attempting to blobize [key_name_admin(H)]", 1)
|
||||
H.blobize()
|
||||
|
||||
|
||||
else if(href_list["forcespeech"])
|
||||
if(!check_rights(R_FUN)) return
|
||||
@@ -1915,19 +1900,6 @@
|
||||
message_admins("[key_name_admin(usr)] fixed all lights", 1)
|
||||
for(var/obj/machinery/light/L in world)
|
||||
L.fix()
|
||||
if("friendai")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","FA")
|
||||
for(var/mob/aiEye/aE in mob_list)
|
||||
aE.icon_state = "ai_friend"
|
||||
for(var/obj/machinery/M in machines)
|
||||
if(istype(M, /obj/machinery/ai_status_display))
|
||||
var/obj/machinery/ai_status_display/A = M
|
||||
A.emotion = "Friend Computer"
|
||||
else if(istype(M, /obj/machinery/status_display))
|
||||
var/obj/machinery/status_display/A = M
|
||||
A.friendc = 1
|
||||
message_admins("[key_name_admin(usr)] turned all AIs into best friends.", 1)
|
||||
if("floorlava")
|
||||
if(floorIsLava)
|
||||
usr << "The floor is lava already."
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// Camera mob, used by AI camera and blob.
|
||||
|
||||
/mob/camera
|
||||
name = "camera mob"
|
||||
density = 0
|
||||
status_flags = GODMODE // You can't damage it.
|
||||
mouse_opacity = 0
|
||||
see_in_dark = 7
|
||||
invisibility = 101 // No one can see us
|
||||
|
||||
move_on_shuttle = 0
|
||||
|
||||
/mob/camera/experience_pressure_difference()
|
||||
return
|
||||
@@ -1,258 +0,0 @@
|
||||
/mob/living/blob
|
||||
name = "blob fragment"
|
||||
real_name = "blob fragment"
|
||||
icon = 'icons/mob/blob.dmi'
|
||||
icon_state = "blob_spore_temp"
|
||||
pass_flags = PASSBLOB
|
||||
see_in_dark = 8
|
||||
see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
var/ghost_name = "Unknown"
|
||||
var/creating_blob = 0
|
||||
faction = "blob"
|
||||
|
||||
|
||||
New()
|
||||
real_name += " [pick(rand(1, 99))]"
|
||||
name = real_name
|
||||
..()
|
||||
|
||||
|
||||
say(var/message)
|
||||
return//No talking for you
|
||||
|
||||
|
||||
emote(var/act,var/m_type=1,var/message = null)
|
||||
return
|
||||
|
||||
|
||||
Life()
|
||||
set invisibility = 0
|
||||
set background = 1
|
||||
|
||||
clamp_values()
|
||||
UpdateDamage()
|
||||
if(health < 0)
|
||||
src.dust()
|
||||
|
||||
|
||||
proc/clamp_values()
|
||||
AdjustStunned(0)
|
||||
AdjustParalysis(0)
|
||||
AdjustWeakened(0)
|
||||
sleeping = 0
|
||||
if(stat)
|
||||
stat = CONSCIOUS
|
||||
return
|
||||
|
||||
|
||||
proc/UpdateDamage()
|
||||
health = 60 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
|
||||
return
|
||||
|
||||
|
||||
death(gibbed)
|
||||
if(key)
|
||||
var/mob/dead/observer/ghost = new(src)
|
||||
ghost.name = ghost_name
|
||||
ghost.real_name = ghost_name
|
||||
ghost.key = key
|
||||
if (ghost.client)
|
||||
ghost.client.eye = ghost
|
||||
return ..(gibbed)
|
||||
|
||||
|
||||
blob_act()
|
||||
src << "The blob attempts to reabsorb you."
|
||||
adjustToxLoss(20)
|
||||
return
|
||||
|
||||
|
||||
Process_Spacemove()
|
||||
if(locate(/obj/effect/blob) in oview(1,src))
|
||||
return 1
|
||||
return (..())
|
||||
|
||||
|
||||
/mob/living/blob/verb/create_node()
|
||||
set category = "Blob"
|
||||
set name = "Create Node"
|
||||
set desc = "Create a Node."
|
||||
if(creating_blob) return
|
||||
var/turf/T = get_turf(src)
|
||||
creating_blob = 1
|
||||
if(!T)
|
||||
creating_blob = 0
|
||||
return
|
||||
var/obj/effect/blob/B = (locate(/obj/effect/blob) in T)
|
||||
if(!B)//We are on a blob
|
||||
usr << "There is no blob here!"
|
||||
creating_blob = 0
|
||||
return
|
||||
if(istype(B,/obj/effect/blob/node)||istype(B,/obj/effect/blob/core)||istype(B,/obj/effect/blob/factory))
|
||||
usr << "Unable to use this blob, find a normal one."
|
||||
creating_blob = 0
|
||||
return
|
||||
for(var/obj/effect/blob/node/blob in orange(5))
|
||||
usr << "There is another node nearby, move more than 5 tiles away from it!"
|
||||
creating_blob = 0
|
||||
return
|
||||
for(var/obj/effect/blob/factory/blob in orange(2))
|
||||
usr << "There is a porus blob nearby, move more than 2 tiles away from it!"
|
||||
creating_blob = 0
|
||||
B.change_to("Node")
|
||||
src.dust()
|
||||
return
|
||||
|
||||
|
||||
/mob/living/blob/verb/create_factory()
|
||||
set category = "Blob"
|
||||
set name = "Create Defense"
|
||||
set desc = "Create a Spore producing blob."
|
||||
if(creating_blob) return
|
||||
var/turf/T = get_turf(src)
|
||||
creating_blob = 1
|
||||
if(!T)
|
||||
creating_blob = 0
|
||||
return
|
||||
var/obj/effect/blob/B = (locate(/obj/effect/blob) in T)
|
||||
if(!B)
|
||||
usr << "You must be on a blob!"
|
||||
creating_blob = 0
|
||||
return
|
||||
if(istype(B,/obj/effect/blob/node)||istype(B,/obj/effect/blob/core)||istype(B,/obj/effect/blob/factory))
|
||||
usr << "Unable to use this blob, find a normal one."
|
||||
creating_blob = 0
|
||||
return
|
||||
for(var/obj/effect/blob/blob in orange(2))//Not right next to nodes/cores
|
||||
if(istype(B,/obj/effect/blob/node))
|
||||
usr << "There is a node nearby, move away from it!"
|
||||
creating_blob = 0
|
||||
return
|
||||
if(istype(B,/obj/effect/blob/core))
|
||||
usr << "There is a core nearby, move away from it!"
|
||||
creating_blob = 0
|
||||
return
|
||||
if(istype(B,/obj/effect/blob/factory))
|
||||
usr << "There is another porous blob nearby, move away from it!"
|
||||
creating_blob = 0
|
||||
return
|
||||
B.change_to("Factory")
|
||||
src.dust()
|
||||
return
|
||||
|
||||
|
||||
/mob/living/blob/verb/revert()
|
||||
set category = "Blob"
|
||||
set name = "Purge Defense"
|
||||
set desc = "Removes a porous blob."
|
||||
if(creating_blob) return
|
||||
var/turf/T = get_turf(src)
|
||||
creating_blob = 1
|
||||
if(!T)
|
||||
creating_blob = 0
|
||||
return
|
||||
var/obj/effect/blob/B = (locate(/obj/effect/blob) in T)
|
||||
if(!B)
|
||||
usr << "You must be on a blob!"
|
||||
creating_blob = 0
|
||||
return
|
||||
if(!istype(B,/obj/effect/blob/factory))
|
||||
usr << "Unable to use this blob, find another one."
|
||||
creating_blob = 0
|
||||
return
|
||||
B.change_to("Normal")
|
||||
src.dust()
|
||||
return
|
||||
|
||||
|
||||
/mob/living/blob/verb/spawn_blob()
|
||||
set category = "Blob"
|
||||
set name = "Create new blob"
|
||||
set desc = "Attempts to create a new blob in this tile."
|
||||
if(creating_blob) return
|
||||
var/turf/T = get_turf(src)
|
||||
creating_blob = 1
|
||||
if(!T)
|
||||
creating_blob = 0
|
||||
return
|
||||
var/obj/effect/blob/B = (locate(/obj/effect/blob) in T)
|
||||
if(B)
|
||||
usr << "There is a blob here!"
|
||||
creating_blob = 0
|
||||
return
|
||||
new/obj/effect/blob(src.loc)
|
||||
src.dust()
|
||||
return
|
||||
|
||||
|
||||
/mob/proc/Blobize()
|
||||
/client/proc/Blobcount()
|
||||
set category = "Debug"
|
||||
set name = "blobreport"
|
||||
set desc = "blob report."
|
||||
set hidden = 1
|
||||
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
if(ticker && ticker.mode)
|
||||
src << "blobs: [blobs.len]"
|
||||
src << "cores: [blob_cores.len]"
|
||||
src << "nodes: [blob_nodes.len]"
|
||||
return
|
||||
|
||||
|
||||
/client/proc/Blobize()//Mostly stolen from the respawn command
|
||||
set category = "Debug"
|
||||
set name = "Ghostblob"
|
||||
set desc = "Ghost into blobthing."
|
||||
set hidden = 1
|
||||
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
var/input = input(src, "Please specify which key will be turned into a bloby.", "Key", "")
|
||||
|
||||
var/mob/dead/observer/G_found
|
||||
if(!input)
|
||||
var/list/ghosts = list()
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
ghosts += G
|
||||
if(ghosts.len)
|
||||
G_found = pick(ghosts)
|
||||
|
||||
else
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
if(G.client&&ckey(G.key)==ckey(input))
|
||||
G_found = G
|
||||
break
|
||||
|
||||
if(!G_found)//If a ghost was not found.
|
||||
alert("There is no active key like that in the game or the person is not currently a ghost. Aborting command.")
|
||||
return
|
||||
|
||||
if(G_found.client)
|
||||
G_found.client.screen.len = null
|
||||
var/mob/living/blob/B = new/mob/living/blob(locate(0,0,1))//temp area also just in case should do this better but tired
|
||||
if(blob_cores.len > 0)
|
||||
var/obj/effect/blob/core/core = pick(blob_cores)
|
||||
if(core)
|
||||
B.loc = core.loc
|
||||
B.ghost_name = G_found.real_name
|
||||
if (G_found.client)
|
||||
G_found.client.mob = B
|
||||
B.verbs += /mob/living/blob/verb/create_node
|
||||
B.verbs += /mob/living/blob/verb/create_factory
|
||||
B << "<B>You are now a blob fragment.</B>"
|
||||
B << "You are a weak bit that has temporarily broken off of the blob."
|
||||
B << "If you stay on the blob for too long you will likely be reabsorbed."
|
||||
B << "If you stray from the blob you will likely be killed by other organisms."
|
||||
B << "You have the power to create a new blob node that will help expand the blob."
|
||||
B << "To create this node you will have to be on a normal blob tile and far enough away from any other node."
|
||||
B << "Check your Blob verbs and hit Create Node to build a node."
|
||||
spawn(10)
|
||||
del(G_found)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ var/datum/cameranet/cameranet = new()
|
||||
|
||||
// Updates what the aiEye can see. It is recommended you use this when the aiEye moves or it's location is set.
|
||||
|
||||
/datum/cameranet/proc/visibility(mob/aiEye/ai)
|
||||
/datum/cameranet/proc/visibility(mob/camera/aiEye/ai)
|
||||
// 0xf = 15
|
||||
var/x1 = max(0, ai.x - 16) & ~(CHUNK_SIZE - 1)
|
||||
var/y1 = max(0, ai.y - 16) & ~(CHUNK_SIZE - 1)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
// Add an AI eye to the chunk, then update if changed.
|
||||
|
||||
/datum/camerachunk/proc/add(mob/aiEye/ai)
|
||||
/datum/camerachunk/proc/add(mob/camera/aiEye/ai)
|
||||
if(!ai.ai)
|
||||
return
|
||||
ai.visibleCameraChunks += src
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
// Remove an AI eye from the chunk, then update if changed.
|
||||
|
||||
/datum/camerachunk/proc/remove(mob/aiEye/ai)
|
||||
/datum/camerachunk/proc/remove(mob/camera/aiEye/ai)
|
||||
if(!ai.ai)
|
||||
return
|
||||
ai.visibleCameraChunks -= src
|
||||
@@ -105,7 +105,7 @@
|
||||
if(t.obscured)
|
||||
obscured -= t.obscured
|
||||
for(var/eye in seenby)
|
||||
var/mob/aiEye/m = eye
|
||||
var/mob/camera/aiEye/m = eye
|
||||
if(!m || !m.ai)
|
||||
continue
|
||||
if(m.ai.client)
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
obscured += t.obscured
|
||||
for(var/eye in seenby)
|
||||
var/mob/aiEye/m = eye
|
||||
var/mob/camera/aiEye/m = eye
|
||||
if(!m || !m.ai)
|
||||
seenby -= m
|
||||
continue
|
||||
|
||||
@@ -3,40 +3,17 @@
|
||||
// An invisible (no icon) mob that the AI controls to look around the station with.
|
||||
// It streams chunks as it moves around, which will show it what the AI can and cannot see.
|
||||
|
||||
/mob/aiEye
|
||||
/mob/camera/aiEye
|
||||
name = "Inactive AI Eye"
|
||||
icon = 'icons/obj/status_display.dmi' // For AI friend secret shh :o
|
||||
|
||||
var/list/visibleCameraChunks = list()
|
||||
var/mob/living/silicon/ai/ai = null
|
||||
density = 0
|
||||
status_flags = GODMODE // You can't damage it.
|
||||
mouse_opacity = 0
|
||||
see_in_dark = 7
|
||||
|
||||
// Movement code. Returns 0 to stop air movement from moving it.
|
||||
/mob/aiEye/Move()
|
||||
return 0
|
||||
|
||||
// Hide popout menu verbs
|
||||
/mob/aiEye/examine()
|
||||
set popup_menu = 0
|
||||
set src = usr.contents
|
||||
return 0
|
||||
|
||||
/mob/aiEye/pull()
|
||||
set popup_menu = 0
|
||||
set src = usr.contents
|
||||
return 0
|
||||
|
||||
/mob/aiEye/point()
|
||||
set popup_menu = 0
|
||||
set src = usr.contents
|
||||
return 0
|
||||
|
||||
// Use this when setting the aiEye's location.
|
||||
// It will also stream the chunk that the new loc is in.
|
||||
|
||||
/mob/aiEye/proc/setLoc(var/T)
|
||||
/mob/camera/aiEye/proc/setLoc(var/T)
|
||||
|
||||
if(ai)
|
||||
if(!isturf(ai.loc))
|
||||
@@ -51,13 +28,16 @@
|
||||
var/obj/machinery/hologram/holopad/H = ai.current
|
||||
H.move_hologram()
|
||||
|
||||
/mob/camera/aiEye/Move()
|
||||
return 0
|
||||
|
||||
|
||||
// AI MOVEMENT
|
||||
|
||||
// The AI's "eye". Described on the top of the page.
|
||||
|
||||
/mob/living/silicon/ai
|
||||
var/mob/aiEye/eyeobj = new()
|
||||
var/mob/camera/aiEye/eyeobj = new()
|
||||
var/sprint = 10
|
||||
var/cooldown = 0
|
||||
var/acceleration = 1
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
stop_automated_movement = 1
|
||||
stance_step++
|
||||
if(stance_step >= 10) //rests for 10 ticks
|
||||
if(target_mob && target_mob in ListTargets())
|
||||
if(target && target in ListTargets())
|
||||
stance = HOSTILE_STANCE_ATTACK //If the mob he was chasing is still nearby, resume the attack, otherwise go idle.
|
||||
else
|
||||
stance = HOSTILE_STANCE_IDLE
|
||||
@@ -72,15 +72,15 @@
|
||||
if(HOSTILE_STANCE_ALERT)
|
||||
stop_automated_movement = 1
|
||||
var/found_mob = 0
|
||||
if(target_mob && target_mob in ListTargets())
|
||||
if(!(SA_attackable(target_mob)))
|
||||
if(target && target in ListTargets())
|
||||
if(!(SA_attackable(target)))
|
||||
stance_step = max(0, stance_step) //If we have not seen a mob in a while, the stance_step will be negative, we need to reset it to 0 as soon as we see a mob again.
|
||||
stance_step++
|
||||
found_mob = 1
|
||||
src.dir = get_dir(src,target_mob) //Keep staring at the mob
|
||||
src.dir = get_dir(src,target) //Keep staring at the mob
|
||||
|
||||
if(stance_step in list(1,4,7)) //every 3 ticks
|
||||
var/action = pick( list( "growls at [target_mob]", "stares angrily at [target_mob]", "prepares to attack [target_mob]", "closely watches [target_mob]" ) )
|
||||
var/action = pick( list( "growls at [target]", "stares angrily at [target]", "prepares to attack [target]", "closely watches [target]" ) )
|
||||
if(action)
|
||||
emote(action)
|
||||
if(!found_mob)
|
||||
@@ -105,14 +105,14 @@
|
||||
if(stance != HOSTILE_STANCE_ATTACK && stance != HOSTILE_STANCE_ATTACKING)
|
||||
stance = HOSTILE_STANCE_ALERT
|
||||
stance_step = 6
|
||||
target_mob = user
|
||||
target = user
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/bear/attack_hand(mob/living/carbon/human/M as mob)
|
||||
if(stance != HOSTILE_STANCE_ATTACK && stance != HOSTILE_STANCE_ATTACKING)
|
||||
stance = HOSTILE_STANCE_ALERT
|
||||
stance_step = 6
|
||||
target_mob = M
|
||||
target = M
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/bear/Process_Spacemove(var/check_drift = 0)
|
||||
@@ -128,22 +128,22 @@
|
||||
..(5)
|
||||
|
||||
/mob/living/simple_animal/hostile/bear/AttackingTarget()
|
||||
emote( pick( list("slashes at [target_mob]", "bites [target_mob]") ) )
|
||||
emote( pick( list("slashes at [target]", "bites [target]") ) )
|
||||
|
||||
var/damage = rand(20,30)
|
||||
|
||||
if(ishuman(target_mob))
|
||||
var/mob/living/carbon/human/H = target_mob
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
|
||||
var/datum/limb/affecting = H.get_organ(ran_zone(dam_zone))
|
||||
H.apply_damage(damage, BRUTE, affecting, H.run_armor_check(affecting, "melee"))
|
||||
return H
|
||||
else if(isliving(target_mob))
|
||||
var/mob/living/L = target_mob
|
||||
else if(isliving(target))
|
||||
var/mob/living/L = target
|
||||
L.adjustBruteLoss(damage)
|
||||
return L
|
||||
else if(istype(target_mob,/obj/mecha))
|
||||
var/obj/mecha/M = target_mob
|
||||
else if(istype(target,/obj/mecha))
|
||||
var/obj/mecha/M = target
|
||||
M.attack_animal(src)
|
||||
return M
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/giant_spider/AttackingTarget()
|
||||
..()
|
||||
if(isliving(target_mob))
|
||||
var/mob/living/L = target_mob
|
||||
if(isliving(target))
|
||||
var/mob/living/L = target
|
||||
if(L.reagents)
|
||||
L.reagents.add_reagent("toxin", poison_per_bite)
|
||||
if(prob(poison_per_bite))
|
||||
@@ -82,7 +82,7 @@
|
||||
for(var/turf/T in orange(20, src))
|
||||
move_targets.Add(T)*/
|
||||
stop_automated_movement = 1
|
||||
walk_to(src, pick(orange(20, src)), 1, move_to_delay)
|
||||
Goto(pick(orange(20, src)), move_to_delay)
|
||||
spawn(50)
|
||||
stop_automated_movement = 0
|
||||
walk(src,0)
|
||||
@@ -107,7 +107,7 @@
|
||||
if(C.stat && !istype(C,/mob/living/simple_animal/hostile/giant_spider))
|
||||
cocoon_target = C
|
||||
busy = MOVING_TO_TARGET
|
||||
walk_to(src, C, 1, move_to_delay)
|
||||
Goto(C, move_to_delay)
|
||||
//give up if we can't reach them after 10 seconds
|
||||
GiveUp(C)
|
||||
return
|
||||
@@ -149,7 +149,7 @@
|
||||
cocoon_target = O
|
||||
busy = MOVING_TO_TARGET
|
||||
stop_automated_movement = 1
|
||||
walk_to(src, O, 1, move_to_delay)
|
||||
Goto(O, move_to_delay)
|
||||
//give up if we can't reach them after 10 seconds
|
||||
GiveUp(O)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/mob/living/simple_animal/hostile
|
||||
faction = "hostile"
|
||||
var/stance = HOSTILE_STANCE_IDLE //Used to determine behavior
|
||||
var/mob/living/target_mob
|
||||
var/target
|
||||
var/attack_same = 0
|
||||
var/ranged = 0
|
||||
var/rapid = 0
|
||||
@@ -32,63 +32,68 @@
|
||||
continue
|
||||
else
|
||||
if(!L.stat)
|
||||
stance = HOSTILE_STANCE_ATTACK
|
||||
T = L
|
||||
break
|
||||
|
||||
else if(istype(A, /obj/mecha)) // Our line of sight stuff was already done in ListTargets().
|
||||
var/obj/mecha/M = A
|
||||
if (M.occupant)
|
||||
stance = HOSTILE_STANCE_ATTACK
|
||||
T = M
|
||||
break
|
||||
|
||||
return T
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/GiveTarget(var/new_target)
|
||||
target = new_target
|
||||
stance = HOSTILE_STANCE_ATTACK
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/Goto(var/target, var/delay)
|
||||
walk_to(src, target, 1, delay)
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/Found(var/atom/A)
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/MoveToTarget()
|
||||
stop_automated_movement = 1
|
||||
if(!target_mob || SA_attackable(target_mob))
|
||||
stance = HOSTILE_STANCE_IDLE
|
||||
if(target_mob in ListTargets())
|
||||
if(!target || SA_attackable(target))
|
||||
LoseTarget()
|
||||
if(target in ListTargets())
|
||||
if(ranged)
|
||||
if(get_dist(src, target_mob) <= 6)
|
||||
OpenFire(target_mob)
|
||||
if(get_dist(src, target) <= 6)
|
||||
OpenFire(target)
|
||||
else
|
||||
walk_to(src, target_mob, 1, move_to_delay)
|
||||
Goto(target, move_to_delay)
|
||||
else
|
||||
stance = HOSTILE_STANCE_ATTACKING
|
||||
walk_to(src, target_mob, 1, move_to_delay)
|
||||
Goto(target, move_to_delay)
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/AttackTarget()
|
||||
|
||||
stop_automated_movement = 1
|
||||
if(!target_mob || SA_attackable(target_mob))
|
||||
if(!target || SA_attackable(target))
|
||||
LoseTarget()
|
||||
return 0
|
||||
if(!(target_mob in ListTargets()))
|
||||
if(!(target in ListTargets()))
|
||||
LostTarget()
|
||||
return 0
|
||||
if(get_dist(src, target_mob) <= 1) //Attacking
|
||||
if(get_dist(src, target) <= 1) //Attacking
|
||||
AttackingTarget()
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/AttackingTarget()
|
||||
if(isliving(target_mob))
|
||||
var/mob/living/L = target_mob
|
||||
if(isliving(target))
|
||||
var/mob/living/L = target
|
||||
L.attack_animal(src)
|
||||
return L
|
||||
if(istype(target_mob,/obj/mecha))
|
||||
var/obj/mecha/M = target_mob
|
||||
if(istype(target,/obj/mecha))
|
||||
var/obj/mecha/M = target
|
||||
M.attack_animal(src)
|
||||
return M
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/LoseTarget()
|
||||
stance = HOSTILE_STANCE_IDLE
|
||||
target_mob = null
|
||||
target = null
|
||||
walk(src, 0)
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/LostTarget()
|
||||
@@ -125,7 +130,8 @@
|
||||
if(!stat)
|
||||
switch(stance)
|
||||
if(HOSTILE_STANCE_IDLE)
|
||||
target_mob = FindTarget()
|
||||
var/new_target = FindTarget()
|
||||
GiveTarget(new_target)
|
||||
|
||||
if(HOSTILE_STANCE_ATTACK)
|
||||
DestroySurroundings()
|
||||
@@ -135,8 +141,8 @@
|
||||
DestroySurroundings()
|
||||
AttackTarget()
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/OpenFire(target_mob)
|
||||
var/target = target_mob
|
||||
/mob/living/simple_animal/hostile/proc/OpenFire(var/the_target)
|
||||
var/target = the_target
|
||||
visible_message("\red <b>[src]</b> fires at [target]!", 1)
|
||||
|
||||
var/tturf = get_turf(target)
|
||||
@@ -159,7 +165,7 @@
|
||||
new casingtype
|
||||
|
||||
stance = HOSTILE_STANCE_IDLE
|
||||
target_mob = null
|
||||
target = null
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -217,6 +217,11 @@
|
||||
new meat_type(src.loc)
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/simple_animal/blob_act()
|
||||
adjustBruteLoss(20)
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/say_quote(var/text)
|
||||
if(speak_emote && speak_emote.len)
|
||||
var/emote = pick(speak_emote)
|
||||
@@ -441,13 +446,13 @@
|
||||
/mob/living/simple_animal/adjustBruteLoss(damage)
|
||||
health = Clamp(health - damage, 0, maxHealth)
|
||||
|
||||
/mob/living/simple_animal/proc/SA_attackable(target_mob)
|
||||
if (isliving(target_mob))
|
||||
var/mob/living/L = target_mob
|
||||
/mob/living/simple_animal/proc/SA_attackable(target)
|
||||
if (isliving(target))
|
||||
var/mob/living/L = target
|
||||
if(!L.stat)
|
||||
return (0)
|
||||
if (istype(target_mob,/obj/mecha))
|
||||
var/obj/mecha/M = target_mob
|
||||
return 0
|
||||
if (istype(target,/obj/mecha))
|
||||
var/obj/mecha/M = target
|
||||
if (M.occupant)
|
||||
return (0)
|
||||
return (1)
|
||||
return 0
|
||||
return 1
|
||||
@@ -135,6 +135,7 @@
|
||||
var/say_message = null // When you are understood by others. Currently only used by aliens and monkeys in their say_quote procs
|
||||
|
||||
var/faction = "neutral" //Used for checking whether hostile simple animals will attack you, possibly more stuff later
|
||||
var/move_on_shuttle = 1 // Can move on the shuttle.
|
||||
|
||||
//The last mob/living/carbon to push/drag/grab this mob (mostly used by slimes friend recognition)
|
||||
var/mob/living/carbon/LAssailant = null
|
||||
|
||||
@@ -211,16 +211,16 @@
|
||||
return 0 //This is sota the goto stop mobs from moving var
|
||||
if(mob.control_object)
|
||||
return Move_object(direct)
|
||||
if(isobserver(mob))
|
||||
return mob.Move(n,direct)
|
||||
if(moving)
|
||||
return 0
|
||||
if(world.time < move_delay)
|
||||
return 0
|
||||
if(mob.stat == DEAD)
|
||||
return 0
|
||||
if(isAI(mob))
|
||||
return AIMove(n,direct,mob)
|
||||
if(!isliving(mob))
|
||||
return mob.Move(n,direct)
|
||||
if(moving)
|
||||
return 0
|
||||
if(mob.stat == DEAD)
|
||||
return 0
|
||||
if(isliving(mob))
|
||||
var/mob/living/L = mob
|
||||
if(L.incorporeal_move) //Move though walls
|
||||
|
||||
@@ -389,27 +389,6 @@
|
||||
. = new_corgi
|
||||
del(src)
|
||||
|
||||
/mob/living/carbon/human/proc/blobize() // Oh boy, this is for you Int - Summoner
|
||||
if (monkeyizing)
|
||||
return
|
||||
for(var/obj/item/W in src)
|
||||
drop_from_inventory(W)
|
||||
regenerate_icons()
|
||||
monkeyizing = 1
|
||||
canmove = 0
|
||||
icon = null
|
||||
invisibility = 101
|
||||
for(var/t in organs)
|
||||
del(t)
|
||||
|
||||
var/mob/living/blob/new_blob = new /mob/living/blob (loc)
|
||||
new_blob.a_intent = "harm"
|
||||
new_blob.key = key
|
||||
|
||||
new_blob << "<B>You are now a Blob Fragment. You can now sacrifice yourself to spawn blobs!</B>"
|
||||
. = new_blob
|
||||
del(src)
|
||||
|
||||
/mob/living/carbon/human/Animalize()
|
||||
|
||||
var/list/mobtypes = typesof(/mob/living/simple_animal)
|
||||
|
||||
@@ -140,8 +140,7 @@
|
||||
return
|
||||
|
||||
/obj/item/weapon/cell/blob_act()
|
||||
if(prob(75))
|
||||
explode()
|
||||
ex_act(1)
|
||||
|
||||
/obj/item/weapon/cell/proc/get_electrocute_damage()
|
||||
switch (charge)
|
||||
|
||||
Reference in New Issue
Block a user