Files
Bubberstation/code/datums/elements/basic_eating.dm
Ben10Omintrix fcc87b4801 virtual pets (#81342)
players can now download their very own virtual pet through a new PDA
app. this pet is called orbie and u can interact with him in alot of
unique ways

happiness can be increased by regularly grooming ur pet, feeding him, or
u can arrange with other players playdates for ur pets, they can play
with each other and both their happiness will increase

u can get food from ur pet through ur pda, it will assign u a random
drop zone location in the station u need to go to, after which u can
obtain ur pet's food then ur PDA will spawn a virtual chocolate bar that
ur pet loves to eat. it wont assign u dropzone locations that are
restricted or hard to reach, however if the area it assigns u is a bit
difficult to get to, u can reroll the location after a small cooldown

u can also level up ur pet to make it gain new helpful abilities and
more cosmetic options. the main way to level up ur pet is by walking it,
so u can have it follow u while u are doing ur job on the station and it
will passively get exp. u get an increased exp modifier per step if ur
pet is happy and not hungry. At level 2, ur pet will gain an ability to
toggle lights and will also read outloud to u any PDA messages u
recieve. at level 3, ur pet gains a camera ability. u can command it to
take a photo afterwhich the picture will be saved directly in ur pda

u also have alot of customization options for ur pet!

u can change its color, name, gender, and u can make it wear hats! u can
unlock more hats for ur pet if u level it up further. these
customizations change ur pet's hologram appearance as well as its
profile picture on the pet network.

u can view how other player's virtual pets are progressing through the
pet network. each time ur pet reaches a new milestone, an update will
automatically be sent out on the network

if ur pet's milestones gets likes from other players, it will become
happier

this app also allows u to program new tricks for ur pet. U can create a
custom trick sequence, and change the trick's name. If u say the trick's
name outloud to ur pet it will do the sequence u programmed.
2024-02-29 04:24:10 +00:00

90 lines
2.9 KiB
Plaintext

/**
* ## basic eating element!
*
* Small behavior for non-carbons to eat certain stuff they interact with
*/
/datum/element/basic_eating
element_flags = ELEMENT_BESPOKE
argument_hash_start_idx = 2
/// Amount to heal
var/heal_amt
/// Amount to hurt
var/damage_amount
/// Type of hurt to apply
var/damage_type
/// Whether to flavor it as drinking rather than eating.
var/drinking
/// Types the animal can eat.
var/list/food_types
/datum/element/basic_eating/Attach(datum/target, heal_amt = 0, damage_amount = 0, damage_type = null, drinking = FALSE, food_types = list())
. = ..()
if(!isliving(target))
return ELEMENT_INCOMPATIBLE
src.heal_amt = heal_amt
src.damage_amount = damage_amount
src.damage_type = damage_type
src.drinking = drinking
src.food_types = food_types
//this lets players eat
RegisterSignal(target, COMSIG_LIVING_UNARMED_ATTACK, PROC_REF(on_unarm_attack))
//this lets ai eat. yes, i'm serious
RegisterSignal(target, COMSIG_HOSTILE_PRE_ATTACKINGTARGET, PROC_REF(on_pre_attackingtarget))
/datum/element/basic_eating/Detach(datum/target)
UnregisterSignal(target, list(COMSIG_LIVING_UNARMED_ATTACK, COMSIG_HOSTILE_PRE_ATTACKINGTARGET))
return ..()
/datum/element/basic_eating/proc/on_unarm_attack(mob/living/eater, atom/target, proximity, modifiers)
SIGNAL_HANDLER
if(!proximity)
return NONE
if(try_eating(eater, target))
return COMPONENT_CANCEL_ATTACK_CHAIN
return NONE
/datum/element/basic_eating/proc/on_pre_attackingtarget(mob/living/eater, atom/target)
SIGNAL_HANDLER
try_eating(eater, target)
/datum/element/basic_eating/proc/try_eating(mob/living/eater, atom/target)
if(!is_type_in_list(target, food_types))
return FALSE
if(SEND_SIGNAL(eater, COMSIG_MOB_PRE_EAT, target) & COMSIG_MOB_CANCEL_EAT)
return FALSE
var/eat_verb
if(drinking)
eat_verb = pick("slurp","sip","guzzle","drink","quaff","suck")
else
eat_verb = pick("bite","chew","nibble","gnaw","gobble","chomp")
if (heal_amt > 0)
var/healed = heal_amt && eater.health < eater.maxHealth
if(heal_amt)
eater.heal_overall_damage(heal_amt)
eater.visible_message(span_notice("[eater] [eat_verb]s [target]."), span_notice("You [eat_verb] [target][healed ? ", restoring some health" : ""]."))
finish_eating(eater, target)
return TRUE
if (damage_amount > 0 && damage_type)
eater.apply_damage(damage_amount, damage_type)
eater.visible_message(span_notice("[eater] [eat_verb]s [target], and seems to hurt itself."), span_notice("You [eat_verb] [target], hurting yourself in the process."))
finish_eating(eater, target)
return TRUE
eater.visible_message(span_notice("[eater] [eat_verb]s [target]."), span_notice("You [eat_verb] [target]."))
finish_eating(eater, target)
return TRUE
/datum/element/basic_eating/proc/finish_eating(mob/living/eater, atom/target)
SEND_SIGNAL(eater, COMSIG_MOB_ATE)
if(drinking)
playsound(eater.loc,'sound/items/drink.ogg', rand(10,50), TRUE)
else
playsound(eater.loc,'sound/items/eatfood.ogg', rand(10,50), TRUE)
qdel(target)