Added skeleton code for mob abilities.

This commit is contained in:
Zuhayr
2013-11-30 00:02:05 +10:30
parent 660a62c4bb
commit 367cc3a827
5 changed files with 112 additions and 3 deletions

View File

@@ -0,0 +1,81 @@
/*
Creature-level abilities.
*/
/var/global/list/ability_verbs = list(
/client/proc/test_ability,
/client/proc/tajaran_ability,
/client/proc/unathi_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."
/client/proc/tajaran_ability()
set category = "Ability"
set name = "Tajaran ability"
set desc = "An ability for Tajara."
// 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."
/client/proc/unathi_ability()
set category = "Ability"
set name = "Unathi ability"
set desc = "An ability for Unathi."
// 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."

View File

@@ -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,10 @@
flags = HAS_SKIN_TONE | HAS_LIPS | HAS_UNDERWEAR
abilities = list(
/client/proc/test_ability,
)
/datum/species/unathi
name = "Unathi"
icobase = 'icons/mob/human_races/r_lizard.dmi'
@@ -65,6 +71,11 @@
flags = WHITELISTED | HAS_LIPS | HAS_UNDERWEAR | HAS_TAIL
abilities = list(
/client/proc/test_ability,
/client/proc/unathi_ability
)
/datum/species/tajaran
name = "Tajaran"
icobase = 'icons/mob/human_races/r_tajaran.dmi'
@@ -87,6 +98,11 @@
flags = WHITELISTED | HAS_LIPS | HAS_UNDERWEAR | HAS_TAIL
abilities = list(
/client/proc/test_ability,
/client/proc/tajaran_ability
)
/datum/species/skrell
name = "Skrell"
icobase = 'icons/mob/human_races/r_skrell.dmi'

View File

@@ -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

View File

@@ -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