Skip to content

Instantly share code, notes, and snippets.

@allison-casey
Created December 26, 2019 05:06
Show Gist options
  • Save allison-casey/3b1a65fdc29c895f20cdd21d6facfefe to your computer and use it in GitHub Desktop.
Save allison-casey/3b1a65fdc29c895f20cdd21d6facfefe to your computer and use it in GitHub Desktop.
;; EFFECTS
;; effects are the fundamentall building block of the engine. they provide a means of interacting with entities and changing their state. they should be as mini.al as possible, leaving the method of their application to higher order elements.
{:type :constant
:target "%.aim"
:operator :add
:value 5}
{:type :expression
:target "%.mobility"
:operator :add
:expression "%.mobility * 0.2"}
{:type :expression
:target "%.will"
:operator :sub
:expression "(min (enemies-in-los %) 5)"}
;; ATTRIBUTES
;; attributes are meant to be a way of budling effects and other associated metadata (possible time-to-live, what to do when they are removed) so that other conponents can apply complex sets of effects by referencing an attribute's key. they can also specify dependencies on other attributes.
;; im still trying to decide if i want ttl's and other action oriented metadata as part of attributes pr not, and if that metadata should be placed in abilities.
{:key :hunkered
:name "Hunkered Down"
:description "Pressed yourself close against yourcover"
:requires {:or [:half-cover :full-cover]}
:effects [{:type constant
:target "%.defense"
:operator :add
:value 20}]}
{:key :acided
:name "Acided"
:description "Covered in toxic acid that's eating away at your armor and effecting your movement."
:ttl 3
:repeats false
:effects [{:type :expression
:target "%.mobility"
:operator :set
:expression "%.mobility / 2"}
{:type :constant
:target "%.aim"
:operator :sub
:value 20}]}
{:key :on-fire
:name "On Fire"
:description "Lit on fire and taking damage over time"
:ttl 3
:repeats true
:effects [{:type :constant
:target "%.health"
:operator :sub
:value 5}]}
;; ENTITIES
;; entities are anything that has a physical manifestation. they are patloads for user defined characteristics that can be targeted by effects.
;; possibly entities would be augmented by systems that provide the actual functionality of being a player, an npc, etc.
{:key :sectoid
:name "Sectoid"
:description "Ayyy Lmao"
:characteristics {:health 100
:mobility 11}
:traits #{}
:abilities #{}
:systems #{}}
;; ABILITIES
;; abilities are functions capable of imparting effects/attributes on command. they cover anything that acts upon the world; shooting, healing, etc.
;; SYSTEMS
;; [LONG TERM GOAL]
;; Systems are modular pieces of functionality that can be applied to entities. they cover anything from movement, player, containers, and more.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment