Browse Source
- Added Math.hpp for some very simple CLAMP, MIN, and MAX macros - Added Blood need - Need conditions are now evaluated by the trigger (better abstracted this way) - Added a sublime-syntax file for my bulid output, because I like colors :) - Added parameters for Min and Max world height to ProceduralWorldcombatComponentRefactor

9 changed files with 183 additions and 13 deletions
@ -1,6 +1,16 @@ |
|||
#include "Needs.hpp" |
|||
|
|||
#include <cmath> |
|||
|
|||
namespace gv |
|||
{ |
|||
ResourceDictionary<NeedDef> g_NeedDefDictionary; |
|||
|
|||
bool NeedLevelTrigger::ConditionsMet(Need& need) const |
|||
{ |
|||
return ( |
|||
(Condition == NeedLevelTrigger::ConditionType::Zero && fabs(need.Level) < 0.01f) || |
|||
(Condition == NeedLevelTrigger::ConditionType::GreaterThanLevel && need.Level > Level) || |
|||
(Condition == NeedLevelTrigger::ConditionType::LessThanLevel && need.Level < Level)); |
|||
} |
|||
} |
@ -0,0 +1,123 @@ |
|||
%YAML 1.2 |
|||
--- |
|||
name: JamUnrealBuildOutput |
|||
file_extensions: [JamUnrealBuildOut] |
|||
scope: source.jamunrealbuildout |
|||
|
|||
# To install |
|||
# 1. Preferences -> Browse Packages -> User |
|||
# 2. Open any JamUnrealBuildout |
|||
# 3. Go to View -> Syntax -> Open all with current extension as... -> JamUnrealBuildout (or User -> JamUnrealBuildout) |
|||
|
|||
contexts: |
|||
main: |
|||
- include: comments |
|||
- include: numbers |
|||
- include: operators |
|||
- include: strings |
|||
|
|||
# Expression control functions |
|||
- match: \b(if|else|for|while|endif|elif)\b |
|||
scope: keyword.control.jamunrealbuildout |
|||
|
|||
- match: \b(and|in|is|not|or)\b |
|||
comment: keyword operators that evaluate to True or False |
|||
scope: keyword.operator.logical.jamunrealbuildout |
|||
|
|||
# Expression constants |
|||
- match: \b(True|False|true|false)\b |
|||
scope: constant.language.jamunrealbuildout |
|||
|
|||
# Operations |
|||
- match: \b(Lib|Link|Initializing|Done|mono|found|updating|Clean|updated|Chmod1|C++|Archive|Ranlib|Compile|Using|Performing|make)\b |
|||
scope: keyword.control.jamunrealbuildout |
|||
|
|||
# Keywords |
|||
- match: \b(clang|undefined|target|Makefile|expected|unknown|type|expression|unused|seconds)\b |
|||
scope: storage.type.class.jamunrealbuildout |
|||
|
|||
# Errors |
|||
- match: \b(error|warning|Error|Warning|failed|errors)\b |
|||
scope: invalid.jamunrealbuildout |
|||
|
|||
comments: |
|||
- match: "#" |
|||
scope: punctuation.definition.comment.jamunrealbuildout |
|||
push: |
|||
- meta_scope: comment.line.number-sign.jamunrealbuildout |
|||
- match: \n |
|||
pop: true |
|||
|
|||
# Copied from Python.sublime-syntax |
|||
numbers: |
|||
- match: \b(?i:(0x\h*)L) |
|||
scope: constant.numeric.integer.long.hexadecimal.jamunrealbuildout |
|||
- match: \b(?i:(0x\h*)) |
|||
scope: constant.numeric.integer.hexadecimal.jamunrealbuildout |
|||
- match: '\b(?i:(0[0-7]+)L)' |
|||
scope: constant.numeric.integer.long.octal.jamunrealbuildout |
|||
- match: '\b(0[0-7]+)' |
|||
scope: constant.numeric.integer.octal.jamunrealbuildout |
|||
- match: '\b(?i:(((\d+(\.(?=[^a-zA-Z_])\d*)?|\.\d+)(e[\-\+]?\d+)?))J)' |
|||
scope: constant.numeric.complex.jamunrealbuildout |
|||
- match: '\b(?i:(\d+\.\d*(e[\-\+]?\d+)?))(?=[^a-zA-Z_])' |
|||
scope: constant.numeric.float.jamunrealbuildout |
|||
- match: '(?i:(\.\d+(e[\-\+]?\d+)?))' |
|||
scope: constant.numeric.float.jamunrealbuildout |
|||
- match: '\b(?i:(\d+e[\-\+]?\d+))' |
|||
scope: constant.numeric.float.jamunrealbuildout |
|||
- match: '\b(?i:([1-9]+[0-9]*|0)L)' |
|||
scope: constant.numeric.integer.long.decimal.jamunrealbuildout |
|||
- match: '\b([1-9]+[0-9]*|0)' |
|||
scope: constant.numeric.integer.decimal.jamunrealbuildout |
|||
|
|||
# Copied from Python.sublime-syntax |
|||
operators: |
|||
- match: <> |
|||
scope: invalid.deprecated.operator.jamunrealbuildout |
|||
- match: <\=|>\=|\=\=|<|>|\!\= |
|||
scope: keyword.operator.comparison.jamunrealbuildout |
|||
- match: \+\=|-\=|\*\=|/\=|//\=|%\=|&\=|\|\=|\^\=|>>\=|<<\=|\*\*\= |
|||
scope: keyword.operator.assignment.augmented.jamunrealbuildout |
|||
- match: \+|\-|\*|\*\*|/|//|%|<<|>>|&|\||\^|~ |
|||
scope: keyword.operator.arithmetic.jamunrealbuildout |
|||
- match: \= |
|||
scope: keyword.operator.assignment.jamunrealbuildout |
|||
|
|||
# Copied from Python.sublime-syntax |
|||
strings: |
|||
- match: '([uU]?)([\"\[])' |
|||
captures: |
|||
1: storage.type.string.jamunrealbuildout |
|||
2: punctuation.definition.string.begin.jamunrealbuildout |
|||
push: |
|||
- meta_scope: string.quoted.double.block.jamunrealbuildout |
|||
- match: '([\"\]])|(\n)' |
|||
captures: |
|||
1: punctuation.definition.string.end.jamunrealbuildout |
|||
2: invalid.illegal.unclosed-string.jamunrealbuildout |
|||
pop: true |
|||
- include: escaped_unicode_char |
|||
- include: escaped_char |
|||
- include: constant_placeholder |
|||
|
|||
# Copied from Python.sublime-syntax |
|||
escaped_unicode_char: |
|||
- match: '(\\U\h{8})|(\\u\h{4})|(\\N\{[a-zA-Z ]+\})' |
|||
captures: |
|||
1: constant.character.escape.unicode.16-bit-hex.jamunrealbuildout |
|||
2: constant.character.escape.unicode.32-bit-hex.jamunrealbuildout |
|||
3: constant.character.escape.unicode.name.jamunrealbuildout |
|||
|
|||
# Copied from Python.sublime-syntax |
|||
escaped_char: |
|||
- match: '(\\x\h{2})|(\\[0-7]{3})|(\\[\\"''abfnrtv])' |
|||
captures: |
|||
1: constant.character.escape.hex.jamunrealbuildout |
|||
2: constant.character.escape.octal.jamunrealbuildout |
|||
3: constant.character.escape.jamunrealbuildout |
|||
|
|||
# Copied from Python.sublime-syntax |
|||
constant_placeholder: |
|||
- match: '(?i:(%(\([a-z_]+\))?#?0?\-?[ ]?\+?([0-9]*|\*)(\.([0-9]*|\*))?[hL]?[a-z%])|(\{([!\[\].:\w ]+)?\}))' |
|||
scope: constant.other.placeholder.jamunrealbuildout |
@ -0,0 +1,5 @@ |
|||
#pragma once |
|||
|
|||
#define CLAMP(value, min, max) if (value > max) value = max; else if (value < min) value = min; |
|||
#define MIN(a, b) a <= b ? a : b; |
|||
#define MAX(a, b) a >= b ? a : b; |
Loading…
Reference in new issue