1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
| using BaseLib.Abstracts; using BaseLib.Utils.NodeFactories; using MegaCrit.Sts2.Core.Commands; using MegaCrit.Sts2.Core.Entities.Ascension; using MegaCrit.Sts2.Core.Entities.Creatures; using MegaCrit.Sts2.Core.Helpers; using MegaCrit.Sts2.Core.Models.Powers; using MegaCrit.Sts2.Core.MonsterMoves.Intents; using MegaCrit.Sts2.Core.MonsterMoves.MonsterMoveStateMachine; using MegaCrit.Sts2.Core.Nodes.Combat; using MegaCrit.Sts2.Core.Nodes.Vfx; using MegaCrit.Sts2.Core.ValueProps;
namespace Test.Scripts;
public class TestMonster : CustomMonsterModel { public override int MinInitialHp => AscensionHelper.GetValueIfAscension(AscensionLevel.ToughEnemies, 120, 100);
public override int MaxInitialHp => AscensionHelper.GetValueIfAscension(AscensionLevel.ToughEnemies, 140, 120);
private int BasicDamage => AscensionHelper.GetValueIfAscension(AscensionLevel.DeadlyEnemies, 12, 10); private int BasicBlock => 8;
private int HeavyDamage => AscensionHelper.GetValueIfAscension(AscensionLevel.DeadlyEnemies, 24, 20);
public override NCreatureVisuals? CreateCustomVisuals() => NodeFactory<NCreatureVisuals>.CreateFromScene("res://test/scenes/test_monster.tscn");
public override async Task AfterAddedToRoom() { await PowerCmd.Apply<StrengthPower>(Creature, 2m, Creature, null); }
protected override MonsterMoveStateMachine GenerateMoveStateMachine() { var basicAttack = new MoveState( "BASIC_ATTACK", BasicAttackMove, new SingleAttackIntent(BasicDamage), new DefendIntent() );
var heavyAttack = new MoveState( "HEAVY_ATTACK", async targets => await DamageCmd .Attack(HeavyDamage) .FromMonster(this) .WithAttackerFx(null, AttackSfx) .WithHitFx("vfx/vfx_attack_blunt") .Execute(null), new SingleAttackIntent(HeavyDamage) );
basicAttack.FollowUpState = heavyAttack; heavyAttack.FollowUpState = basicAttack;
return new MonsterMoveStateMachine([basicAttack, heavyAttack], basicAttack); }
private async Task BasicAttackMove(IReadOnlyList<Creature> targets) { TalkCmd.Play(L10NMonsterLookup("TEST-TEST_MONSTER.moves.BASIC_ATTACK.banter"), Creature, VfxColor.Blue); await DamageCmd .Attack(BasicDamage) .FromMonster(this) .WithAttackerFx(null, AttackSfx) .WithHitFx("vfx/vfx_attack_blunt") .Execute(null); await CreatureCmd.GainBlock(Creature, BasicBlock, ValueProp.Move, null); } }
|