Skip to content

Commit

Permalink
Shape rework to use nested enums;
Browse files Browse the repository at this point in the history
Add RadialGradient;
Support color alpha;
  • Loading branch information
makscee committed Mar 15, 2024
1 parent 9863167 commit b9c2516
Show file tree
Hide file tree
Showing 46 changed files with 541 additions and 433 deletions.
21 changes: 5 additions & 16 deletions assets/ron/heroes/almsgiver.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,17 @@
name: "Almsgiver",
hp: 3,
atk: 1,
stacks: 1,
level: 1,
houses: "Holy",
description: "%trigger → %effect on %target",
trigger: Fire(trigger: AllySummon, target: Target, effect: UseAbility("Blessing", 0), period: 0),
representation: (
material: Shape(
shape: Circle,
fill: Line,
fill_color: Solid,
size: Vec2E(Sum(Mul(Float(0.08), Index), Sum(Float(0.08), Sub(Zero, Mul(Beat, Float(0.02)))))),
point1: Vec2(1.0, 1.0),
point2: Vec2(1.0, 1.0),
thickness: Sum(Float(0.6), Mul(Sin(Sum(GameTime, Index)), Float(0.4))),
shape: Circle(
radius: Sum(Mul(Float(0.08), Index), Sum(Float(0.08), Sub(Zero, Mul(Beat, Float(0.02))))),
),
shape_type: Line(thickness: Sum(Float(0.6), Mul(Sin(Sum(GameTime, Index)), Float(0.4)))),
fill: Solid(color: State(Color)),
alpha: Float(1.0),
colors: [State(Color)],
parts: [Float(0.0)],
),
children: [],
mapping: {},
count: 8,
),
state: (history: {}, birth: 0.0),
statuses: [],
)
11 changes: 1 addition & 10 deletions assets/ron/heroes/bolla.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
houses: "Dragons",
trigger: Fire(trigger: TurnEnd, effect: UseAbility("Grow", 0)),
representation: (
material: Shape(
shape: Circle,
fill: Opaque,
size: Vec2E(Float(0.5)),
thickness: Float(1.0),
alpha: Float(0.2),
),
children: [],
material: Shape(shape: Circle(radius: Float(0.5)), shape_type: Opaque, alpha: Float(0.2)),
mapping: {
Offset: Mul(
UnitVec(
Expand All @@ -30,6 +23,4 @@
},
count: 6,
),
state: (history: {}, birth: 0.0),
statuses: [],
)
24 changes: 10 additions & 14 deletions assets/ron/heroes/coach.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,17 @@
trigger: Fire(trigger: AllySummon, target: Target, effect: UseAbility("Strength", 0), period: 0),
representation: (
material: Shape(
shape: Rectangle,
fill: Line,
fill_color: Solid,
size: Vec2E(Sum(Mul(Float(0.16), Index), Sum(Float(0.08), Sub(Zero, Mul(Beat, Float(0.02)))))),
point1: Vec2(1.0, 1.0),
point2: Vec2(1.0, 1.0),
thickness: Sum(Float(0.6), Mul(Sin(Sum(GameTime, Index)), Float(0.4))),
alpha: Float(1.0),
colors: [State(Color)],
parts: [Float(0.0)],
shape: Rectangle(
size: Vec2E(
Sum(
Mul(Float(0.16), Index),
Sum(Float(0.08), Sub(Zero, Mul(Beat, Float(0.02)))),
),
),
),
shape_type: Line(thickness: Sum(Float(0.6), Mul(Sin(Sum(GameTime, Index)), Float(0.4)))),
fill: Solid(color: State(Color)),
),
children: [],
mapping: {},
count: 8,
),
state: (history: {}, birth: 0.0),
statuses: [],
)
6 changes: 2 additions & 4 deletions assets/ron/heroes/crusader.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
),
representation: (
material: Shape(
shape: Rectangle,
fill: Line,
size: Vec2(0.5, 1.82),
thickness: Float(3.0),
shape: Rectangle(size: Vec2(0.5, 1.82)),
shape_type: Line(thickness: Float(3.0)),
alpha: Float(0.3),
),
children: [],
Expand Down
19 changes: 5 additions & 14 deletions assets/ron/heroes/custodian.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,12 @@
trigger: Fire(trigger: AllySummon, target: Target, effect: UseAbility("Shield", 0), period: 0),
representation: (
material: Shape(
shape: Circle,
fill: Line,
fill_color: Solid,
size: Vec2E(Sum(Mul(Float(0.05), Index), Sum(Float(0.52), Sub(Zero, Mul(Beat, Float(0.02)))))),
point1: Vec2(1.0, 1.0),
point2: Vec2(1.0, 1.0),
thickness: Sum(Float(0.6), Mul(Sin(Sum(GameTime, Index)), Float(0.4))),
alpha: Float(1.0),
colors: [State(Color)],
parts: [Float(0.0)],
shape: Circle(
radius: Sum(Mul(Float(0.05), Index), Sum(Float(0.52), Sub(Zero, Mul(Beat, Float(0.02))))),
),
shape_type: Line(thickness: Sum(Float(0.6), Mul(Sin(Sum(GameTime, Index)), Float(0.4)))),
fill: Solid(color: State(Color)),
),
children: [],
mapping: {},
count: 8,
),
state: (history: {}, birth: 0.0),
statuses: [],
)
6 changes: 2 additions & 4 deletions assets/ron/heroes/doppelganger.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
trigger: Fire(trigger: BattleStart, target: RandomAdjacentUnit, effect: UseAbility("Copy", 0)),
representation: (
material: Shape(
shape: Circle,
fill: Line,
size: Vec2E(Float(0.72)),
thickness: Float(2.0),
shape: Circle(radius: Float(0.72)),
shape_type: Line(thickness: Float(2.0)),
alpha: Float(0.4),
),
children: [],
Expand Down
10 changes: 2 additions & 8 deletions assets/ron/heroes/equalizer.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
children: [
(
material: Shape(
shape: Rectangle,
fill: Line,
size: Vec2E(Float(1.5)),
thickness: Float(1.0),
shape: Rectangle(size: Vec2E(Float(1.5))),
shape_type: Line(thickness: Float(1.0)),
alpha: Float(1.0),
),
children: [],
Expand All @@ -32,9 +30,5 @@
count: 8,
),
],
mapping: {},
count: 0,
),
state: (history: {}, birth: 0.0),
statuses: [],
)
6 changes: 2 additions & 4 deletions assets/ron/heroes/fertilizer.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
trigger: Fire(trigger: BattleStart, target: AllAllyUnits, effect: UseAbility("Thorns", 0), period: 0),
representation: (
material: Shape(
shape: Rectangle,
fill: Line,
size: Vec2E(Float(1.0)),
thickness: Float(2.0),
shape: Rectangle(size: Vec2E(Float(1.0))),
shape_type: Line(thickness: Float(2.0)),
alpha: Float(1.0),
),
children: [],
Expand Down
19 changes: 10 additions & 9 deletions assets/ron/heroes/fungoid.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@
),
representation: (
material: Shape(
shape: Circle,
fill: Line,
fill_color: GradientLinear2,
size: Vec2E(Sum(Mul(Index, Float(-0.18)), Sum(Float(0.6), Mul(Sub(Zero, Beat), Float(0.05))))),
point1: UnitVec(Mul(GameTime, Float(0.3))),
point2: UnitVec(Sum(Mul(GameTime, Float(0.3)), PI)),
thickness: Float(1.4),
shape: Circle(
radius: Sum(Mul(Index, Float(-0.18)), Sum(Float(0.6), Mul(Sub(Zero, Beat), Float(0.05)))),
),
shape_type: Line(thickness: Float(1.4)),
fill: GradientLinear(
point1: UnitVec(Mul(GameTime, Float(0.3))),
point2: UnitVec(Sum(Mul(GameTime, Float(0.3)), PI)),
parts: [Float(0.5), Float(0.51)],
colors: [State(Color), Hex("101010ff")],
),
alpha: Float(1.0),
colors: [State(Color), Hex("101010ff")],
parts: [Float(0.5), Float(0.51)],
),
children: [],
mapping: {Rotation: Mul(Index, Float(0.2)), Offset: Mul(UnitVec(Sum(GameTime, Index)), Float(0.07))},
Expand Down
24 changes: 15 additions & 9 deletions assets/ron/heroes/gardener.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@
trigger: Fire(trigger: TurnEnd, target: SlotUnit(Int(1)), effect: UseAbility("Thorns", 0), period: 0),
representation: (
material: Shape(
shape: Rectangle,
fill: Line,
fill_color: GradientLinear2,
size: Vec2E(Sum(Mul(Index, Float(-0.03)), Sum(Float(1.23), Mul(Sub(Zero, Beat), Float(0.1))))),
point1: UnitVec(Mul(GameTime, Float(0.3))),
point2: UnitVec(Sum(Mul(GameTime, Float(0.3)), PI)),
thickness: Float(1.4),
shape: Rectangle(
size: Vec2E(
Sum(
Mul(Index, Float(-0.03)),
Sum(Float(1.23), Mul(Sub(Zero, Beat), Float(0.1))),
),
),
),
shape_type: Line(thickness: Float(1.4)),
fill: GradientLinear(
point1: UnitVec(Mul(GameTime, Float(0.3))),
point2: UnitVec(Sum(Mul(GameTime, Float(0.3)), PI)),
colors: [State(Color), Hex("101010ff")],
parts: [Float(0.5), Float(0.51)],
),
alpha: Float(1.0),
colors: [State(Color), Hex("101010ff")],
parts: [Float(0.5), Float(0.51)],
),
children: [],
mapping: {Rotation: Mul(Index, Float(0.18))},
Expand Down
6 changes: 2 additions & 4 deletions assets/ron/heroes/guardian.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
),
representation: (
material: Shape(
shape: Circle,
fill: Line,
size: Vec2E(Float(0.8)),
thickness: Float(0.6),
shape: Circle(radius: Float(0.8)),
shape_type: Line(thickness: Float(0.6)),
alpha: Float(1.0),
),
children: [],
Expand Down
8 changes: 3 additions & 5 deletions assets/ron/heroes/henchman.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
trigger: Fire(trigger: BattleStart, target: Owner, effect: UseAbility("Doom", 0), period: 0),
representation: (
material: Shape(
shape: Circle,
fill: Line,
size: Vec2E(
Sum(
shape: Circle(
radius: Sum(
Float(0.5),
Mul(Sin(GameTime), Sum(Float(0.1), Mul(Sub(Zero, Beat), Float(0.2)))),
),
),
thickness: Float(1.0),
shape_type: Line(thickness: Float(1.0)),
alpha: Float(1.0),
),
children: [],
Expand Down
8 changes: 3 additions & 5 deletions assets/ron/heroes/inciter.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
),
representation: (
material: Shape(
shape: Circle,
fill: Line,
size: Vec2E(
Max(
shape: Circle(
radius: Max(
Mul(Abs(Beat), Float(0.5)),
Mul(Abs(Cos(Mul(GameTime, Float(0.3)))), Float(0.2)),
),
),
thickness: Float(1.0),
shape_type: Line(thickness: Float(1.0)),
alpha: Float(0.3),
),
children: [],
Expand Down
12 changes: 3 additions & 9 deletions assets/ron/heroes/injector.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@
trigger: Fire(trigger: AfterDamageDealt, target: Target, effect: UseAbility("Plague", 0), period: 0),
representation: (
material: Shape(
shape: Circle,
fill: Line,
fill_color: Solid,
size: Vec2E(Sub(Float(0.19), Mul(Index, Float(0.02)))),
point1: Vec2(1.0, 1.0),
point2: Vec2(1.0, 1.0),
thickness: Float(1.0),
shape: Circle(radius: Sub(Float(0.19), Mul(Index, Float(0.02)))),
shape_type: Line(thickness: Float(1.0)),
fill: Solid(color: State(Color)),
alpha: Float(1.0),
colors: [State(Color)],
parts: [Float(0.0)],
),
children: [],
mapping: {
Expand Down
8 changes: 3 additions & 5 deletions assets/ron/heroes/mentalist.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
trigger: Fire(trigger: BattleStart, target: AllUnits, effect: UseAbility("Amnesia", 0)),
representation: (
material: Shape(
shape: Circle,
fill: Opaque,
size: Vec2E(Float(0.25)),
thickness: Float(1.3),
alpha: If(Equals(State(Index), Zero), Float(0.6), Float(0.1)),
shape: Circle(radius: Float(0.25)),
shape_type: Opaque,
alpha: If(Equals(State(Index), Zero), Float(1.0), Float(0.1)),
),
children: [],
mapping: {
Expand Down
6 changes: 2 additions & 4 deletions assets/ron/heroes/mesmerist.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
trigger: Fire(trigger: BattleStart, target: RandomEnemy, effect: UseAbility("Betray", 0), period: 0),
representation: (
material: Shape(
shape: Circle,
fill: Line,
size: Vec2E(Mul(Index, Mul(Float(0.1), Abs(Sin(Sum(GameTime, Index)))))),
thickness: Float(1.0),
shape: Circle(radius: Mul(Index, Mul(Float(0.1), Abs(Sin(Sum(GameTime, Index)))))),
shape_type: Line(thickness: Float(1.0)),
alpha: Float(1.0),
),
children: [],
Expand Down
12 changes: 3 additions & 9 deletions assets/ron/heroes/morbid.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,10 @@
),
representation: (
material: Shape(
shape: Rectangle,
fill: Line,
fill_color: Solid,
size: Vec2E(Float(0.35)),
point1: Vec2(1.0, 1.0),
point2: Vec2(1.0, 1.0),
thickness: Float(0.5),
shape: Rectangle(size: Vec2E(Float(0.35))),
shape_type: Line(thickness: Float(0.5)),
fill: Solid(color: State(Color)),
alpha: Sin(Sum(Mul(GameTime, Float(1.0)), Mul(Index, Float(1000.0)))),
colors: [State(Color)],
parts: [Float(0.0)],
),
children: [],
mapping: {Offset: Mul(UnitVec(Mul(RandomFloat(Owner), PI)), Float(0.67))},
Expand Down
19 changes: 10 additions & 9 deletions assets/ron/heroes/planter.unit.ron
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
trigger: Fire(trigger: BattleStart, target: Owner, effect: UseAbility("Summon Treant", 0), period: 0),
representation: (
material: Shape(
shape: Circle,
fill: Line,
fill_color: GradientLinear2,
size: Vec2E(Sum(Mul(Index, Float(-0.89)), Sum(Float(0.79), Mul(Sub(Zero, Beat), Float(0.1))))),
point1: UnitVec(Mul(GameTime, Float(0.3))),
point2: UnitVec(Sum(Mul(GameTime, Float(0.3)), PI)),
thickness: Float(1.4),
shape: Circle(
radius: Sum(Mul(Index, Float(-0.89)), Sum(Float(0.79), Mul(Sub(Zero, Beat), Float(0.1)))),
),
shape_type: Line(thickness: Float(1.4)),
fill: GradientLinear(
point1: UnitVec(Mul(GameTime, Float(0.3))),
point2: UnitVec(Sum(Mul(GameTime, Float(0.3)), PI)),
colors: [State(Color), Hex("101010ff")],
parts: [Float(0.5), Float(0.51)],
),
alpha: Float(1.0),
colors: [State(Color), Hex("101010ff")],
parts: [Float(0.5), Float(0.51)],
),
children: [],
mapping: {Rotation: Mul(Index, Float(0.18))},
Expand Down
Loading

0 comments on commit b9c2516

Please sign in to comment.