-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* virtual pets * Update emote.dm * Update emote.dm * We are going to modularize this correctly --------- Co-authored-by: Ben10Omintrix <[email protected]> Co-authored-by: Bloop <[email protected]>
- Loading branch information
1 parent
1e68b4f
commit 17a297a
Showing
31 changed files
with
1,528 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,36 @@ | ||
/datum/element/cleaning | ||
|
||
/datum/element/cleaning/Attach(datum/target) | ||
. = ..() | ||
if(!ismovable(target)) | ||
return ELEMENT_INCOMPATIBLE | ||
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(Clean)) | ||
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(clean)) | ||
|
||
/datum/element/cleaning/Detach(datum/target) | ||
. = ..() | ||
UnregisterSignal(target, COMSIG_MOVABLE_MOVED) | ||
|
||
/datum/element/cleaning/proc/Clean(datum/source) | ||
/datum/element/cleaning/proc/clean(datum/source) | ||
SIGNAL_HANDLER | ||
|
||
var/atom/movable/AM = source | ||
var/turf/tile = AM.loc | ||
var/atom/movable/atom_movable = source | ||
var/turf/tile = atom_movable.loc | ||
if(!isturf(tile)) | ||
return | ||
|
||
tile.wash(CLEAN_SCRUB) | ||
for(var/A in tile) | ||
for(var/atom/cleaned as anything in tile) | ||
// Clean small items that are lying on the ground | ||
if(isitem(A)) | ||
var/obj/item/I = A | ||
if(I.w_class <= WEIGHT_CLASS_SMALL && !ismob(I.loc)) | ||
I.wash(CLEAN_SCRUB) | ||
if(isitem(cleaned)) | ||
var/obj/item/cleaned_item = cleaned | ||
if(cleaned_item.w_class <= WEIGHT_CLASS_SMALL) | ||
cleaned_item.wash(CLEAN_SCRUB) | ||
continue | ||
// Clean humans that are lying down | ||
else if(ishuman(A)) | ||
var/mob/living/carbon/human/cleaned_human = A | ||
if(cleaned_human.body_position == LYING_DOWN) | ||
cleaned_human.wash(CLEAN_SCRUB) | ||
cleaned_human.regenerate_icons() | ||
to_chat(cleaned_human, span_danger("[AM] cleans your face!")) | ||
if(!ishuman(cleaned)) | ||
continue | ||
var/mob/living/carbon/human/cleaned_human = cleaned | ||
if(cleaned_human.body_position == LYING_DOWN) | ||
cleaned_human.wash(CLEAN_SCRUB) | ||
cleaned_human.regenerate_icons() | ||
to_chat(cleaned_human, span_danger("[atom_movable] cleans your face!")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#define ORBIE_MAXIMUM_HEALTH 300 | ||
|
||
/mob/living/basic/orbie | ||
name = "Orbie" | ||
desc = "An orb shaped hologram." | ||
icon = 'icons/mob/simple/pets.dmi' | ||
icon_state = "orbie" | ||
icon_living = "orbie" | ||
speed = 0 | ||
maxHealth = 100 | ||
light_on = FALSE | ||
light_system = OVERLAY_LIGHT | ||
light_range = 6 | ||
light_color = "#64bee1" | ||
health = 100 | ||
habitable_atmos = list("min_oxy" = 0, "max_oxy" = 0, "min_plas" = 0, "max_plas" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) | ||
unsuitable_atmos_damage = 0 | ||
can_buckle_to = FALSE | ||
density = FALSE | ||
pass_flags = PASSMOB | ||
move_force = 0 | ||
move_resist = 0 | ||
pull_force = 0 | ||
minimum_survivable_temperature = TCMB | ||
maximum_survivable_temperature = INFINITY | ||
death_message = "fades out of existence!" | ||
ai_controller = /datum/ai_controller/basic_controller/orbie | ||
///are we happy or not? | ||
var/happy_state = FALSE | ||
///overlay for our neutral eyes | ||
var/static/mutable_appearance/eyes_overlay = mutable_appearance('icons/mob/simple/pets.dmi', "orbie_eye_overlay") | ||
///overlay for when our eyes are emitting light | ||
var/static/mutable_appearance/orbie_light_overlay = mutable_appearance('icons/mob/simple/pets.dmi', "orbie_light_overlay") | ||
///overlay for the flame propellar | ||
var/static/mutable_appearance/flame_overlay = mutable_appearance('icons/mob/simple/pets.dmi', "orbie_flame_overlay") | ||
///overlay for our happy eyes | ||
var/static/mutable_appearance/happy_eyes_overlay = mutable_appearance('icons/mob/simple/pets.dmi', "orbie_happy_eye_overlay") | ||
///commands we can give orbie | ||
var/list/pet_commands = list( | ||
/datum/pet_command/idle, | ||
/datum/pet_command/free, | ||
/datum/pet_command/untargeted_ability/pet_lights, | ||
/datum/pet_command/point_targeting/use_ability/take_photo, | ||
/datum/pet_command/follow/orbie, | ||
/datum/pet_command/perform_trick_sequence, | ||
) | ||
|
||
/mob/living/basic/orbie/Initialize(mapload) | ||
. = ..() | ||
var/static/list/food_types = list(/obj/item/food/virtual_chocolate) | ||
AddComponent(/datum/component/obeys_commands, pet_commands) | ||
AddElement(/datum/element/basic_eating, food_types = food_types) | ||
RegisterSignal(src, COMSIG_ATOM_CAN_BE_PULLED, PROC_REF(on_pulled)) | ||
RegisterSignal(src, COMSIG_VIRTUAL_PET_LEVEL_UP, PROC_REF(on_level_up)) | ||
RegisterSignal(src, COMSIG_MOB_CLICKON, PROC_REF(on_click)) | ||
RegisterSignal(src, COMSIG_ATOM_UPDATE_LIGHT_ON, PROC_REF(on_lights)) | ||
ai_controller.set_blackboard_key(BB_BASIC_FOODS, typecacheof(food_types)) | ||
update_appearance() | ||
|
||
/mob/living/basic/orbie/proc/on_click(mob/living/basic/source, atom/target, params) | ||
SIGNAL_HANDLER | ||
|
||
if(!CanReach(target)) | ||
return | ||
|
||
if(src == target || happy_state || !istype(target)) | ||
return | ||
|
||
toggle_happy_state() | ||
addtimer(CALLBACK(src, PROC_REF(toggle_happy_state)), 30 SECONDS) | ||
|
||
/mob/living/basic/orbie/proc/on_lights(datum/source) | ||
SIGNAL_HANDLER | ||
|
||
update_appearance() | ||
|
||
/mob/living/basic/orbie/proc/toggle_happy_state() | ||
happy_state = !happy_state | ||
update_appearance() | ||
|
||
/mob/living/basic/orbie/proc/on_pulled(datum/source) //i need move resist at 0, but i also dont want him to be pulled | ||
SIGNAL_HANDLER | ||
|
||
return COMSIG_ATOM_CANT_PULL | ||
|
||
/mob/living/basic/orbie/proc/on_level_up(datum/source, new_level) | ||
SIGNAL_HANDLER | ||
|
||
if(maxHealth >= ORBIE_MAXIMUM_HEALTH) | ||
UnregisterSignal(src, COMSIG_VIRTUAL_PET_LEVEL_UP) | ||
return | ||
|
||
maxHealth += 100 | ||
heal_overall_damage(maxHealth - health) | ||
|
||
|
||
/mob/living/basic/orbie/update_overlays() | ||
. = ..() | ||
if(stat == DEAD) | ||
return | ||
. += flame_overlay | ||
if(happy_state) | ||
. += happy_eyes_overlay | ||
else if(light_on) | ||
. += orbie_light_overlay | ||
else | ||
. += eyes_overlay | ||
|
||
/mob/living/basic/orbie/gib() | ||
death(TRUE) | ||
|
||
#undef ORBIE_MAXIMUM_HEALTH |
46 changes: 46 additions & 0 deletions
46
code/modules/mob/living/basic/pets/orbie/orbie_abilities.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/datum/action/cooldown/mob_cooldown/lights | ||
name = "Toggle Lights" | ||
button_icon = 'icons/mob/simple/pets.dmi' | ||
button_icon_state = "orbie_light_action" | ||
background_icon_state = "bg_default" | ||
overlay_icon_state = "bg_default_border" | ||
click_to_activate = FALSE | ||
|
||
/datum/action/cooldown/mob_cooldown/lights/Activate() | ||
owner.set_light_on(!owner.light_on) | ||
return TRUE | ||
|
||
|
||
/datum/action/cooldown/mob_cooldown/capture_photo | ||
name = "Camera" | ||
button_icon = 'icons/mob/simple/pets.dmi' | ||
button_icon_state = "orbie_light_action" | ||
background_icon_state = "bg_default" | ||
overlay_icon_state = "bg_default_border" | ||
cooldown_time = 30 SECONDS | ||
///camera we use to take photos | ||
var/obj/item/camera/ability_camera | ||
|
||
/datum/action/cooldown/mob_cooldown/capture_photo/Grant(mob/grant_to) | ||
. = ..() | ||
if(isnull(owner)) | ||
return | ||
ability_camera = new(owner) | ||
ability_camera.print_picture_on_snap = FALSE | ||
RegisterSignal(ability_camera, COMSIG_PREQDELETED, PROC_REF(on_camera_delete)) | ||
|
||
/datum/action/cooldown/mob_cooldown/capture_photo/Activate(atom/target) | ||
if(isnull(ability_camera)) | ||
return FALSE | ||
ability_camera.captureimage(target, owner) | ||
StartCooldown() | ||
return TRUE | ||
|
||
/datum/action/cooldown/mob_cooldown/capture_photo/proc/on_camera_delete(datum/source) | ||
SIGNAL_HANDLER | ||
UnregisterSignal(ability_camera, COMSIG_PREQDELETED) | ||
ability_camera = null | ||
|
||
/datum/action/cooldown/mob_cooldown/capture_photo/Destroy() | ||
QDEL_NULL(ability_camera) | ||
return ..() |
Oops, something went wrong.