Skip to content

Commit

Permalink
Added grafadreka.
Browse files Browse the repository at this point in the history
More work on drakes.

Added grafadreka den site.

Working on refining drake AI.

Fixing drake languages.
  • Loading branch information
MistakeNot4892 committed Aug 13, 2022
1 parent bbddee9 commit dcbf10e
Show file tree
Hide file tree
Showing 31 changed files with 859 additions and 55 deletions.
1 change: 0 additions & 1 deletion code/game/gamemodes/technomancer/spells/control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,3 @@
adjust_instability(controlled_mobs.len)
to_chat(user, "<span class='notice'>You command your [controlled_mobs.len > 1 ? "entities" : "[controlled_mobs[1]]"] to move \
towards \the [T].</span>")

7 changes: 6 additions & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -915,4 +915,9 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.

// this gets called when the item gets chucked by the vending machine
/obj/item/proc/vendor_action(var/obj/machinery/vending/V)
return
return

// Called when a simple animal finishes eating the item.
/obj/item/proc/animal_consumed(var/mob/user)
user.visible_message(SPAN_NOTICE("\The [user] finishes eating \the [src]."), SPAN_NOTICE("You finish eating \the [src]."))
qdel(src)
14 changes: 14 additions & 0 deletions code/game/objects/random/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@
return pick(prob(1);/mob/living/simple_mob/animal/sif/kururak/hibernate,
prob(20);/mob/living/simple_mob/animal/sif/kururak)

/obj/random/mob/sif/grafadreka
name = "Random Grafadreka"
desc = "This is a random grafadreka, either waking or hibernating."
icon_state = "frost"

/obj/random/mob/sif/grafadreka/item_to_spawn()
return pick(prob(3);/mob/living/simple_mob/animal/sif/grafadreka/wild/hibernate,
prob(12);/mob/living/simple_mob/animal/sif/grafadreka/wild)

/obj/random/mob/spider
name = "Random Spider" //Spiders should patrol where they spawn.
desc = "This is a random boring spider."
Expand Down Expand Up @@ -397,6 +406,11 @@
/mob/living/simple_mob/animal/sif/kururak,
/mob/living/simple_mob/animal/sif/kururak
),
prob(3);list(
/mob/living/simple_mob/animal/sif/grafadreka/wild,
/mob/living/simple_mob/animal/sif/grafadreka/wild,
/mob/living/simple_mob/animal/sif/grafadreka/wild
),
prob(5);list(
/mob/living/simple_mob/animal/sif/glitterfly,
/mob/living/simple_mob/animal/sif/glitterfly,
Expand Down
32 changes: 15 additions & 17 deletions code/game/objects/structures/animal_den.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
return TRUE
if(try_grab_occupant(user))
return TRUE
if(!do_after(user, src, 1 SECOND))
if(!do_after(user, 1 SECOND, src))
return TRUE
if(length(contents))
to_chat(user, SPAN_WARNING("You can't hide in \the [src]; it's occupied."))
Expand Down Expand Up @@ -104,7 +104,6 @@
/obj/structure/animal_den/ghost_join
var/mob/living/critter
var/ban_check = "Critter"
var/welcome_text

/obj/structure/animal_den/ghost_join/Initialize()
. = ..()
Expand All @@ -120,40 +119,39 @@
critter = null

/obj/structure/animal_den/ghost_join/examine(mob/user, infix, suffix)
. = ..()
var/list/output = ..()
if(isobserver(user))
if(critter)
if(ban_check && ckey_is_jobbanned(user.ckey, ban_check))
to_chat(user, SPAN_WARNING("You are banned from [ban_check] roles and cannot join via this den."))
output += SPAN_WARNING("You are banned from [ban_check] roles and cannot join via this den.")
else if(user.MayRespawn(TRUE))
to_chat(user, SPAN_NOTICE("<b>Click on the den to join as \a [critter].</b>"))
output += SPAN_NOTICE("<b>Click on the den to join as \a [critter].</b>")
else
to_chat(user, SPAN_WARNING("This den is no longer available for joining."))
output += SPAN_WARNING("This den is no longer available for joining.")
return output

/obj/structure/animal_den/ghost_join/attack_ghost(mob/user)
if(critter)
transfer_personality(user)
if(!critter)
return ..()
if(ban_check && ckey_is_jobbanned(user.ckey, ban_check))
to_chat(user, SPAN_WARNING("You are banned from [ban_check] roles and cannot join via this den."))
return
return ..()
transfer_personality(user)

/obj/structure/animal_den/ghost_join/proc/transfer_personality(var/mob/user)

set waitfor = FALSE
if(!critter)
return

// Transfer over mind and key.
if(user.mind)
user.mind.transfer_to(critter)
else
critter.key = user.key
critter.key = user.key

var/mob/living/critter_ref = critter
critter = null

// Sleep long enough for them to login and get any other text out of the way.
sleep(1)
to_chat(critter_ref, SPAN_NOTICE("<b>You are \a [critter]!</b>"))
if(welcome_text)
to_chat(critter_ref, SPAN_NOTICE(welcome_text))

// Sleep long enough for the logged-in critter to update state and regen icon.
sleep(SSmobs.wait)
if(critter_ref.resting) // get up lazybones
Expand Down
6 changes: 5 additions & 1 deletion code/game/objects/structures/flora/flora.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,13 @@
if(!can_forage(critter))
to_chat(critter, SPAN_WARNING("You cannot see any edible fruit on \the [src]."))
return TRUE
critter.set_AI_busy(TRUE)
show_animal_foraging_message(critter)
if(!do_after(critter, 2 SECONDS, src) || QDELETED(src) || !can_forage(user))
critter.setClickCooldown(5 SECONDS)
if(!do_after(critter, 5 SECONDS, src) || QDELETED(src) || !can_forage(user))
critter.set_AI_busy(FALSE)
return TRUE
critter.set_AI_busy(FALSE)
show_animal_eating_message(critter)
playsound(critter, 'sound/items/eatfood.ogg', rand(10,50), 1)
harvest_count++
Expand Down
1 change: 1 addition & 0 deletions code/game/turfs/simulated/outdoors/outdoors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var/global/list/turf_edge_cache = list()
to_chat(critter, SPAN_WARNING("There is already a den here."))
return TRUE
critter.visible_message(SPAN_NOTICE("\The [critter] begins digging industriously."))
critter.setClickCooldown(10 SECONDS)
if(!do_after(critter, 10 SECONDS, src))
return TRUE
if(locate(/obj/structure/animal_den) in contents)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/ai/interfaces.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@
// Apply movement delay.
// Player movement has more factors but its all in the client and fixing that would be its own project.
setMoveCooldown(movement_delay())
return
return
1 change: 1 addition & 0 deletions code/modules/emotes/definitions/_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ var/global/list/_default_mob_emotes = list(
/decl/emote/audible/choke,
/decl/emote/audible/moan,
/decl/emote/audible/gnarl,
/decl/emote/audible/snarl
)
4 changes: 4 additions & 0 deletions code/modules/emotes/definitions/audible.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
emote_message_3p = "chokes."
conscious = FALSE

/decl/emote/audible/snarl
key = "snarl"
emote_message_3p = "snarls menacingly."

/decl/emote/audible/gnarl
key = "gnarl"
emote_message_3p = "gnarls and shows USER_THEIR teeth."
Expand Down
11 changes: 6 additions & 5 deletions code/modules/emotes/emote_define.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ var/global/list/emotes_by_key
var/emote_message_radio_synthetic // As above, but for synthetics.
var/emote_message_muffled // A message to show if the emote is audible and the user is muzzled.

var/list/emote_sound // A sound for the emote to play.
// Can either be a single sound, a list of sounds to pick from, or an
var/list/emote_sound // A sound for the emote to play.
// Can either be a single sound, a list of sounds to pick from, or an
// associative array of gender to single sounds/a list of sounds.
var/list/emote_sound_synthetic // As above, but used when check_synthetic() is true.
var/emote_volume = 50 // Volume of sound to play.
Expand Down Expand Up @@ -83,7 +83,7 @@ var/global/list/emotes_by_key
var/mob/M = user
if(M.restrained())
to_chat(user, SPAN_WARNING("You are restrained and cannot do that."))
return
return FALSE

var/atom/target
if(can_target() && extra_params)
Expand All @@ -104,7 +104,7 @@ var/global/list/emotes_by_key

if(!target)
to_chat(user, SPAN_WARNING("You cannot see a '[extra_params]' within range."))
return
return FALSE

var/use_1p = get_emote_message_1p(user, target, extra_params)
if(use_1p)
Expand Down Expand Up @@ -136,14 +136,15 @@ var/global/list/emotes_by_key
var/mob/living/L = user
if(L.silent)
M.visible_message(message = "[user] opens their mouth silently!", self_message = "You cannot say anything!", blind_message = emote_message_impaired, runemessage = "opens their mouth silently!")
return
return FALSE
else
M.audible_message(message = use_3p, self_message = use_1p, deaf_message = emote_message_impaired, hearing_distance = use_range, radio_message = use_radio, runemessage = prefinal_3p)
else
M.visible_message(message = use_3p, self_message = use_1p, blind_message = emote_message_impaired, range = use_range, runemessage = prefinal_3p)

do_extra(user, target)
do_sound(user)
return TRUE

/decl/emote/proc/replace_target_tokens(var/msg, var/atom/target)
. = msg
Expand Down
14 changes: 11 additions & 3 deletions code/modules/food/food/snacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,22 @@
/obj/item/reagent_containers/food/snacks/attack_generic(var/mob/living/user)
if(!isanimal(user) && !isalien(user))
return
user.visible_message("<b>[user]</b> nibbles away at \the [src].","You nibble away at \the [src].")
if(isanimal(user))
var/mob/living/simple_mob/animal/critter = user
critter.eat_food_item(src, bitesize)
else
user.visible_message("<b>[user]</b> nibbles away at \the [src].","You nibble away at \the [src].")
if(reagents)
reagents.trans_to_mob(user, bitesize, CHEM_INGEST)
bitecount++
if(reagents)
reagents.trans_to_mob(user, bitesize, CHEM_INGEST)
spawn(5)
if(!src && !user.client)
user.custom_emote(1,"[pick("burps", "cries for more", "burps twice", "looks at the area where the food was")]")
qdel(src)
if(!QDELETED(src))
On_Consume(user)

/obj/item/reagent_containers/food/snacks/animal_consumed(var/mob/user)
On_Consume(user)

//////////////////////////////////////////////////
Expand Down
14 changes: 13 additions & 1 deletion code/modules/mob/language/monkey.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,16 @@
flags = RESTRICTED
machine_understands = 0
space_chance = 100
syllables = list("chirp", "squawk", "tweet")
syllables = list("chirp", "squawk", "tweet")

/datum/language/drake
name = "Drake"
desc = "Hiss hiss, feed me siffets."
speech_verb = "hisses"
ask_verb = "chirps"
exclaim_verb = "rumbles"
key = "D"
flags = RESTRICTED
machine_understands = 0
space_chance = 30
syllables = list("hss", "ssh", "khs", "hrr", "rrr", "rrn")
2 changes: 2 additions & 0 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1161,5 +1161,7 @@
/mob/living/proc/rip_out_internal_organ(var/zone, var/skip_wounding = FALSE, var/damage_descriptor)
if(length(internal_organs))
. = pick_n_take(internal_organs)
if(ispath(.))
. = new .(src)
if(!skip_wounding)
take_damage(rand(10,20))
6 changes: 3 additions & 3 deletions code/modules/mob/living/simple_mob/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Cooldown testing is done at click code (for players) and interface code (for AI).
setClickCooldown(get_attack_speed())

// Returns a value, but will be lost if
// Returns a value, but will be lost if
. = do_attack(A, their_T)

if(melee_attack_delay)
Expand Down Expand Up @@ -103,7 +103,7 @@
try_reload()
return FALSE

visible_message("<span class='danger'><b>\The [src]</b> fires at \the [A]!</span>")
visible_message(SPAN_DANGER("\The [src] [projectileverb] at \the [A]!"))
shoot(A)
if(casingtype)
new casingtype(loc)
Expand Down Expand Up @@ -259,4 +259,4 @@
/mob/living/simple_mob/proc/special_pre_animation(atom/A)
do_windup_animation(A, special_attack_delay) // Semi-placeholder.

/mob/living/simple_mob/proc/special_post_animation(atom/A)
/mob/living/simple_mob/proc/special_post_animation(atom/A)
4 changes: 3 additions & 1 deletion code/modules/mob/living/simple_mob/defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@
apply_damage(damage = harm_intent_damage, damagetype = BURN, def_zone = null, blocked = armor, blocked = resistance, used_weapon = null, sharp = FALSE, edge = FALSE)
L.visible_message("<span class='warning'>\The [L] [response_harm] \the [src]!</span>")
L.do_attack_animation(src)
IWasAttackedBy(L)

return

/mob/living/simple_mob/proc/IWasAttackedBy(var/mob/living/attacker)
return

// When somoene clicks us with an item in hand
/mob/living/simple_mob/attackby(var/obj/item/O, var/mob/user)
Expand Down Expand Up @@ -304,4 +307,3 @@
if(ignore_thickness)
return TRUE
return !thick_armor

30 changes: 24 additions & 6 deletions code/modules/mob/living/simple_mob/harvesting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,31 @@

/mob/living/simple_mob/examine(mob/user)
. = ..()
if(stat != DEAD && user && harvest_tool && (get_dist(user, src) <= 3))
. += "<span class='notice'>\The [src] can be [harvest_verb] with a [initial(harvest_tool.name)] every [round(harvest_cooldown, 0.1)] minutes.</span>"
var/time_to_harvest = (harvest_recent + harvest_cooldown) - world.time
if(time_to_harvest > 0)
. += "<span class='notice'>It can be [harvest_verb] in [time_to_harvest / (1 MINUTE)] second(s).</span>"
if(user && (get_dist(user, src) <= 3))

var/datum/gender/G = gender_datums[get_visible_gender()]
if(stat == DEAD)
. += "<b><span class='cult'>[G.He] [G.is] dead.</span></b>"
return

if(harvest_tool)
. += SPAN_NOTICE("\The [src] can be [harvest_verb] with a [initial(harvest_tool.name)] every [round(harvest_cooldown, 0.1)] minutes.")
var/time_to_harvest = (harvest_recent + harvest_cooldown) - world.time
if(time_to_harvest > 0)
. += SPAN_NOTICE("It can be [harvest_verb] in [time_to_harvest / (1 MINUTE)] second(s).")
else
. += SPAN_NOTICE("It can be [harvest_verb] now.")

var/percent_health = health / maxHealth
if(percent_health >= 1)
. += SPAN_NOTICE("[G.He] [G.is] uninjured.")
else if(percent_health >= 0.7)
. += SPAN_WARNING("[G.He] [G.is] mildly injured.")
else if(percent_health >= 0.4)
. += SPAN_WARNING("[G.He] [G.is] moderately injured.")
else
. += "<span class='notice'>It can be [harvest_verb] now.</span>"
. += SPAN_DANGER("[G.He] [G.is] badly injured.")


/mob/living/simple_mob/proc/livestock_harvest(var/obj/item/tool, var/mob/living/user)
if(!LAZYLEN(harvest_results)) // Might be a unique interaction of an object using the proc to do something weird, or just someone's a donk.
Expand Down
5 changes: 4 additions & 1 deletion code/modules/mob/living/simple_mob/on_click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
if(can_special_attack(A) && special_attack_target(A))
return

if(projectiletype)
if(can_projectile_attack(A))
shoot_target(A)

/mob/living/simple_mob/proc/can_projectile_attack(var/atom/A)
return !!projectiletype

/mob/living/simple_mob/proc/do_interaction(var/atom/A)
switch(a_intent)
if(I_HURT)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/living/simple_mob/simple_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
var/special_attack_charges = null // If set, special attacks will work off of a charge system, and won't be usable if all charges are expended. Good for grenades.
var/special_attack_cooldown = null // If set, special attacks will have a cooldown between uses.
var/last_special_attack = null // world.time when a special attack occured last, for cooldown calculations.
var/projectileverb = "fires"

//Damage resistances
var/grab_resist = 0 // Chance for a grab attempt to fail. Note that this is not a true resist and is just a prob() of failure.
Expand Down Expand Up @@ -285,4 +286,4 @@
add_overlay(hud_list)

/decl/mob_organ_names
var/list/hit_zones = list("body") //When in doubt, it's probably got a body.
var/list/hit_zones = list("body") //When in doubt, it's probably got a body.
Loading

0 comments on commit dcbf10e

Please sign in to comment.