mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-26 01:52:29 +00:00
Merge pull request #4023 from Zuhayr/feature
Ability skeleton code, basic cryopod functionality.
This commit is contained in:
35
code/modules/mob/abilities.dm
Normal file
35
code/modules/mob/abilities.dm
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Creature-level abilities.
|
||||
*/
|
||||
|
||||
/var/global/list/ability_verbs = list( )
|
||||
|
||||
/*
|
||||
|
||||
Example ability:
|
||||
|
||||
/client/proc/test_ability()
|
||||
|
||||
set category = "Ability"
|
||||
set name = "Test ability"
|
||||
set desc = "An ability for testing."
|
||||
|
||||
// Check if the client has a mob and if the mob is valid and alive.
|
||||
if(!mob || !istype(mob,/mob/living) || mob.stat)
|
||||
src << "\red You must be corporeal and alive to do that."
|
||||
return 0
|
||||
|
||||
//Handcuff check.
|
||||
if(mob.restrained())
|
||||
src << "\red You cannot do this while restrained."
|
||||
return 0
|
||||
|
||||
if(istype(mob,/mob/living/carbon))
|
||||
var/mob/living/carbon/M = mob
|
||||
if(M.handcuffed)
|
||||
src << "\red You cannot do this while cuffed."
|
||||
return 0
|
||||
|
||||
src << "\blue You perform an ability."
|
||||
|
||||
*/
|
||||
@@ -37,6 +37,8 @@
|
||||
|
||||
var/flags = 0 // Various specific features.
|
||||
|
||||
var/list/abilities = list() // For species-derived or admin-given powers
|
||||
|
||||
/datum/species/human
|
||||
name = "Human"
|
||||
language = "Sol Common"
|
||||
@@ -44,6 +46,9 @@
|
||||
|
||||
flags = HAS_SKIN_TONE | HAS_LIPS | HAS_UNDERWEAR
|
||||
|
||||
//If you wanted to add a species-level ability:
|
||||
/*abilities = list(/client/proc/test_ability)*/
|
||||
|
||||
/datum/species/unathi
|
||||
name = "Unathi"
|
||||
icobase = 'icons/mob/human_races/r_lizard.dmi'
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
log_access("Notice: [key_name(src)] has the same [matches] as [key_name(M)] (no longer logged in).")
|
||||
|
||||
/mob/Login()
|
||||
|
||||
player_list |= src
|
||||
update_Login_details()
|
||||
world.update_status()
|
||||
@@ -44,4 +45,13 @@
|
||||
client.eye = src
|
||||
client.perspective = MOB_PERSPECTIVE
|
||||
|
||||
//Clear ability list and update from mob.
|
||||
client.verbs -= ability_verbs
|
||||
|
||||
if(abilities)
|
||||
client.verbs |= abilities
|
||||
|
||||
if(istype(src,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = src
|
||||
if(H.species && H.species.abilities)
|
||||
client.verbs |= H.species.abilities
|
||||
@@ -84,10 +84,11 @@
|
||||
var/lastpuke = 0
|
||||
var/unacidable = 0
|
||||
var/small = 0
|
||||
var/list/pinned = list() //List of things pinning this creature to walls (see living_defense.dm)
|
||||
var/list/embedded = list() //Embedded items, since simple mobs don't have organs.
|
||||
var/list/pinned = list() // List of things pinning this creature to walls (see living_defense.dm)
|
||||
var/list/embedded = list() // Embedded items, since simple mobs don't have organs.
|
||||
var/list/languages = list() // For speaking/listening.
|
||||
var/list/speak_emote = list("says") //Verbs used when speaking. Defaults to 'say' if speak_emote is null.
|
||||
var/list/abilities = list() // For species-derived or admin-given powers.
|
||||
var/list/speak_emote = list("says") // Verbs used when speaking. Defaults to 'say' if speak_emote is null.
|
||||
|
||||
var/name_archive //For admin things like possession
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
icon_state = "dispenser"
|
||||
use_power = 0
|
||||
idle_power_usage = 40
|
||||
var/ui_name = "Chem Dispenser 5000"
|
||||
var/ui_name = "Chem Dispenser 5000"
|
||||
var/energy = 100
|
||||
var/max_energy = 100
|
||||
var/amount = 30
|
||||
var/amount = 30
|
||||
var/accept_glass = 0
|
||||
var/beaker = null
|
||||
var/recharged = 0
|
||||
@@ -434,7 +434,6 @@
|
||||
reagents.clear_reagents()
|
||||
icon_state = "mixer0"
|
||||
else if (href_list["createpill"] || href_list["createpill_multiple"])
|
||||
|
||||
var/count = 1
|
||||
|
||||
if(reagents.total_volume/count < 1) //Sanity checking.
|
||||
@@ -448,12 +447,11 @@
|
||||
|
||||
var/amount_per_pill = reagents.total_volume/count
|
||||
if (amount_per_pill > 50) amount_per_pill = 50
|
||||
|
||||
|
||||
var/name = reject_bad_text(input(usr,"Name:","Name your pill!","[reagents.get_master_reagent_name()] ([amount_per_pill] units)"))
|
||||
|
||||
if(reagents.total_volume/count < 1) //Sanity checking.
|
||||
return
|
||||
|
||||
while (count--)
|
||||
var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src.loc)
|
||||
if(!name) name = reagents.get_master_reagent_name()
|
||||
|
||||
Reference in New Issue
Block a user