From 4194556cb83a1ff270c084d13f966779b2a1f3df Mon Sep 17 00:00:00 2001 From: cha0s Date: Tue, 2 Feb 2021 01:22:50 -0600 Subject: [PATCH] feat: Fleshed out Alive --- .../entity/src/trait-components/alive.jsx | 61 +++++++++++++++---- .../entity/src/trait-components/alive.scss | 8 +++ 2 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 packages/entity/src/trait-components/alive.scss diff --git a/packages/entity/src/trait-components/alive.jsx b/packages/entity/src/trait-components/alive.jsx index e815826..2df8767 100644 --- a/packages/entity/src/trait-components/alive.jsx +++ b/packages/entity/src/trait-components/alive.jsx @@ -1,25 +1,63 @@ import {join} from 'path'; import {PropTypes, React} from '@latus/react'; +import {Number} from '@persea/core'; +import {useJsonPatcher} from '@persea/json'; +import Condition from '../behavior-components/condition'; import Expressions from '../behavior-components/expressions'; const Alive = ({ entity, json, path, -}) => ( -
-
-
Death actions
- +}) => { + const patch = useJsonPatcher(); + return ( +
+
+
Death actions
+ +
+
+
Death condition
+ +
+
-
-); + ); +}; Alive.displayName = 'Alive'; @@ -33,7 +71,6 @@ Alive.propTypes = { expressions: PropTypes.arrayOf(PropTypes.shape({})), }), deathCondition: PropTypes.shape({}), - deathSound: PropTypes.string, }), state: PropTypes.shape({ life: PropTypes.number, diff --git a/packages/entity/src/trait-components/alive.scss b/packages/entity/src/trait-components/alive.scss new file mode 100644 index 0000000..3539059 --- /dev/null +++ b/packages/entity/src/trait-components/alive.scss @@ -0,0 +1,8 @@ +.alive__life { + align-items: center; + display: flex; +} + +.alive__life-separator { + padding: 0 0.5em; +}