Skip to content

Commit

Permalink
Support 'When enemy robots are adjacent to this structure all adjacen…
Browse files Browse the repository at this point in the history
…t enemy robots can't attack'
  • Loading branch information
AlexNisnevich committed Aug 22, 2023
1 parent 74bc4ea commit a923bf1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/scala/wordbots/Lexicon.scala
Original file line number Diff line number Diff line change
Expand Up @@ -389,16 +389,14 @@ object Lexicon {
(NP|Num, λ {amount: Number => Life(amount)}),
(NP/Adj, λ {amount: Number => Life(amount)})
)) +
("if" -> Seq(
((S|S)|S, λ {c: GlobalCondition => λ {a: Action => If(c, a)}}), // "if" for actions
((S|S)|S, λ {c: GlobalCondition => λ {a: PassiveAbility => a.conditionOn(c)}}) // "if" for abilities
)) +
("if" -> ((S|S)|S, λ {c: GlobalCondition => λ {a: Action => If(c, a)}})) + // "if" for actions
(Seq("if", "when", "whenever") -> ((S|S)|S, λ {c: GlobalCondition => λ {a: PassiveAbility => a.conditionOn(c)}})) + // "if" for abilities
(Seq("in", "on", "of", "from", "into") -> (PP/NP, identity)) +
("increase" -> ((S/PP)/N, λ {a: TargetAttribute => λ {i: Scalar => ModifyAttribute(a.target, a.attr, Plus(i))}})) + // e.g. "increase its attack by X"
("instead" -> (S|S, λ {a: Action => Instead(a)})) +
("in combat" -> (S\S, λ {t: AfterDestroyed => AfterDestroyed(t.target, Combat)})) +
(Seq("in play", "on the board") -> (NP\N, λ {o: ObjectType => ObjectsInPlay(o)})) +
("is" -> (X|X, identity)) +
(Seq("is", "are") -> (X|X, identity)) +
("it" -> (NP, ItO: Sem)) +
("its" -> Seq(
(Num/N, λ {a: SingleAttribute => AttributeValue(ItO, a)}),
Expand Down

0 comments on commit a923bf1

Please sign in to comment.