Overmap exoplanet generation, ported from Bay. (#12362)

This commit is contained in:
Matt Atlas
2022-01-17 22:16:48 -03:00
committed by GitHub
parent 918d43972e
commit 5bcf84cb23
84 changed files with 2321 additions and 4654 deletions
+13 -7
View File
@@ -265,13 +265,6 @@ var/list/holder_mob_icon_cache = list()
var/list/generate_for_slots = list(slot_l_hand_str, slot_r_hand_str, slot_back_str)
slot_flags = SLOT_BACK
/obj/item/holder/proc/sync(var/mob/living/M)
src.name = M.name
src.overlays = M.overlays
dir = M.dir
reagents = M.reagents
/obj/item/holder/human/sync(var/mob/living/M)
cut_overlays()
// Generate appropriate on-mob icons.
@@ -354,6 +347,19 @@ var/list/holder_mob_icon_cache = list()
H.change_animal_name(usr)
sync(contained)
/obj/item/holder/proc/sync(var/mob/living/M)
dir = SOUTH
cut_overlays()
icon = M.icon
icon_state = M.icon_state
item_state = M.item_state
color = M.color
name = M.name
desc = M.desc
overlays |= M.overlays
update_held_icon()
//#TODO-MERGE
//Port the reduced-duplication holder method from baystation upstream:
//https://github.com/Baystation12/Baystation12/blob/master/code/modules/mob/holder.dm
+10 -3
View File
@@ -409,9 +409,9 @@ var/list/slot_equipment_priority = list( \
return FALSE
/mob/proc/delete_inventory(var/include_carried = FALSE)
for(var/entry in get_equipped_items(include_carried))
drop_from_inventory(entry)
qdel(entry)
for(var/obj/item/I as anything in get_equipped_items(include_carried))
drop_from_inventory(I)
qdel(I)
/mob/proc/get_covering_equipped_items(var/body_parts)
. = list()
@@ -447,3 +447,10 @@ var/list/slot_equipment_priority = list( \
return FALSE
return O.pre_equip(src, visualsOnly)
// Returns the first item which covers any given body part
/mob/proc/get_covering_equipped_item(var/body_parts)
for(var/entry in get_equipped_items())
var/obj/item/I = entry
if(I.body_parts_covered & body_parts)
return I
@@ -484,3 +484,8 @@ This saves us from having to call add_fingerprint() any time something is put in
return
is_noisy = TRUE
/mob/living/carbon/human/proc/get_covering_equipped_item_by_zone(var/zone)
var/obj/item/organ/external/O = get_organ(zone)
if(O)
return get_covering_equipped_item(O.body_part)
@@ -98,7 +98,7 @@
icon_state = "toxin"
// Xenoarch aliens.
/mob/living/simple_animal/hostile/samak
/mob/living/simple_animal/hostile/retaliate/samak
name = "samak"
desc = "A fast, armored predator accustomed to hiding and ambushing in cold terrain."
faction = "samak"
@@ -120,7 +120,7 @@
emote_hear = list("snuffles")
mob_size = 10
/mob/living/simple_animal/hostile/diyaab
/mob/living/simple_animal/hostile/retaliate/diyaab
name = "diyaab"
desc = "A small pack animal. Although omnivorous, it will hunt meat on occasion."
faction = "diyaab"
@@ -144,7 +144,7 @@
density = 0
mob_size = 3
/mob/living/simple_animal/hostile/shantak
/mob/living/simple_animal/hostile/retaliate/shantak
name = "shantak"
desc = "A piglike creature with a bright iridiscent mane that sparkles as though lit by an inner light. Don't be fooled by its beauty though."
faction = "shantak"
@@ -25,6 +25,7 @@
var/list/targets = list()
var/attacked_times = 0
var/list/target_type_validator_map = list()
var/list/tolerated_types = list()
var/attack_emote = "stares menacingly at"
var/smart_melee = TRUE // This makes melee mobs try to stay two tiles away from their target in combat, lunging in to attack only
@@ -171,6 +172,9 @@ mob/living/simple_animal/hostile/hitby(atom/movable/AM as mob|obj,var/speed = TH
else
return 0
/mob/living/simple_animal/hostile/proc/on_attack_mob(var/mob/hit_mob)
return
/mob/living/simple_animal/hostile/proc/AttackingTarget()
setClickCooldown(attack_delay)
if(!Adjacent(target_mob))
@@ -189,6 +193,7 @@ mob/living/simple_animal/hostile/hitby(atom/movable/AM as mob|obj,var/speed = TH
if(isliving(target_mob))
var/mob/living/L = target_mob
L.attack_generic(src, rand(melee_damage_lower, melee_damage_upper), attacktext)
on_attack_mob(L)
target = L
else if(istype(target_mob, /obj/machinery/bot))
var/obj/machinery/bot/B = target_mob
@@ -409,6 +414,8 @@ mob/living/simple_animal/hostile/hitby(atom/movable/AM as mob|obj,var/speed = TH
current_health = M.health
if(L.health < current_health)
return TRUE
if(tolerated_types[L.type] == TRUE)
return FALSE
return FALSE
/mob/living/simple_animal/hostile/proc/validator_bot(var/obj/machinery/bot/B, var/atom/current)
@@ -0,0 +1,71 @@
/mob/living/simple_animal/thinbug
name = "taki"
desc = "It looks like a bunch of legs."
icon_state = "thinbug"
icon_living = "thinbug"
icon_dead = "thinbug_dead"
mob_size = MOB_MINISCULE
density = FALSE
emote_hear = list("scratches the ground", "rubs its legs together", "chitters")
/mob/living/simple_animal/hostile/retaliate/royalcrab
name = "cragenoy"
desc = "It looks like a crustacean with an exceedingly hard carapace. Watch the pinchers!"
faction = "crab"
icon_state = "royalcrab"
icon_living = "royalcrab"
icon_dead = "royalcrab_dead"
move_to_delay = 3
maxHealth = 150
health = 150
speed = 1
melee_damage_lower = 10
melee_damage_upper = 15
natural_armor = list(
melee = ARMOR_MELEE_RESISTANT
)
emote_see = list("skitters","oozes liquid from its mouth", "scratches at the ground", "clicks its claws")
/mob/living/simple_animal/hostile/retaliate/beast/charbaby
name = "charbaby"
desc = "A huge grubby creature."
icon_state = "char"
icon_living = "char"
icon_dead = "char_dead"
mob_size = MOB_LARGE
health = 45
maxHealth = 45
speed = 2
response_help = "pats briefly"
response_disarm = "gently pushes"
response_harm = "strikes"
harm_intent_damage = 1
melee_damage_lower = 5
melee_damage_upper = 10
blood_color = COLOR_RED
natural_armor = list(
laser = ARMOR_LASER_PISTOL
)
/mob/living/simple_animal/hostile/retaliate/beast/charbaby/on_attack_mob(var/mob/hit_mob)
. = ..()
if(isliving(hit_mob) && prob(25))
var/mob/living/L = hit_mob
if(prob(10))
L.adjust_fire_stacks(1)
L.IgniteMob()
/mob/living/simple_animal/hostile/retaliate/beast/charbaby/attack_hand(mob/living/carbon/human/H)
. = ..()
reflect_unarmed_damage(H, BURN, "amorphous mass")
/mob/living/simple_animal/hostile/retaliate/beast/shantak/lava
desc = "A vaguely canine looking beast. It looks as though its fur is made of stone wool."
icon_state = "lavadog"
icon_living = "lavadog"
icon_dead = "lavadog_dead"
speak = list("Karuph!", "Karump!")
@@ -27,4 +27,26 @@
for(var/mob/living/simple_animal/hostile/retaliate/H in view(world.view, get_turf(src)))
if(H.faction == faction)
H.enemies |= M
H.enemies |= M
/mob/living/simple_animal/proc/name_species()
set name = "Name Alien Species"
set category = "Object"
set src in view()
if(!current_map.use_overmap)
return
if(use_check_and_message(usr))
return
for(var/obj/effect/overmap/visitable/sector/exoplanet/E in SSshuttle.initialized_sectors)
if(src in E.animals)
var/newname = input("What do you want to name this species?", "Species naming", E.get_random_species_name()) as text|null
newname = sanitizeName(newname, allow_numbers = TRUE)
if(newname && !use_check_and_message(usr))
if(E.rename_species(type, newname))
to_chat(usr,"<span class='notice'>This species will be known from now on as '[newname]'.</span>")
else
to_chat(usr,"<span class='warning'>This species has already been named!</span>")
return
@@ -136,6 +136,13 @@
var/psi_pingable = TRUE
var/armor_type = /datum/component/armor
var/list/natural_armor //what armor animal has
//for simple animals that reflect damage when attacked in melee
var/return_damage_min
var/return_damage_max
/mob/living/simple_animal/proc/update_nutrition_stats()
nutrition_step = mob_size * 0.03 * metabolic_factor
@@ -160,6 +167,9 @@
udder = new(50)
udder.my_atom = src
if(LAZYLEN(natural_armor))
AddComponent(armor_type, natural_armor)
/mob/living/simple_animal/Move(NewLoc, direct)
. = ..()
if(.)
@@ -940,6 +950,17 @@
else
return FALSE
/mob/living/simple_animal/proc/reflect_unarmed_damage(var/mob/living/carbon/human/attacker, var/damage_type, var/description)
if(attacker.a_intent == I_HURT)
var/hand_hurtie
if(attacker.hand)
hand_hurtie = BP_L_HAND
else
hand_hurtie = BP_R_HAND
attacker.apply_damage(rand(return_damage_min, return_damage_max), damage_type, hand_hurtie, used_weapon = description)
if(rand(25))
to_chat(attacker, SPAN_WARNING("Your attack has no obvious effect on \the [src]'s [description]!"))
#undef BLOOD_NONE
#undef BLOOD_LIGHT
#undef BLOOD_MEDIUM