Skip to content

Commit

Permalink
Merge pull request #2 from PoryGoneDev/badeline-chasers
Browse files Browse the repository at this point in the history
v1.2.0 Feature Update
  • Loading branch information
PoryGone authored Apr 25, 2024
2 parents 5e09c49 + 21c44f3 commit 1119813
Show file tree
Hide file tree
Showing 21 changed files with 443 additions and 15 deletions.
Binary file added Content/Sprites/AirDash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Content/Sprites/AirDashGrey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Content/Sprites/BadelineDisabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Content/Sprites/Climb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Content/Sprites/ClimbGrey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Content/Sprites/GroundDash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Content/Sprites/GroundDashGrey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Content/Sprites/SkidJump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Content/Sprites/SkidJumpGrey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Content/Text/English.json
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,11 @@
"Voice": "credits/credits_12",
"Text": "Heidy would like to thank\nBrian for being awesome\nand Furi for being purrfect!"
},
{
"Face": "signpost",
"Voice": "sign/general_06",
"Text": "PoryGone would like to thank\nRaspberrySpaceJam and TheBulblaxEmpire\nfor ideas, testing, and friendship."
},
{
"Face": "signpost",
"Voice": "credits/credits_13",
Expand Down
6 changes: 6 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ Ported to the Archipelago Multiworld framework in a week(ish) by PoryGone, this
- Springs
- Breakable Blocks

Optionally, `Move Shuffle` can be activated, which also shuffles:
- Ground Dash
- Air Dash
- Skid Jump
- Climb

The goal is to collect a certain number of Strawberries, then visit Badeline on her floating island.

See the setup guide found [here](https://archipelago.gg/games/Celeste%2064/info/en).
Expand Down
4 changes: 4 additions & 0 deletions Source/Actors/Badeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ private CoEnumerator Conversation(Cutscene cs)

int index = Save.CurrentRecord.GetFlag(TALK_FLAG) + 1;
yield return Co.Run(cs.Say(Loc.Lines($"Baddy{index}")));
if (Game.Instance.ArchipelagoManager.Friendsanity)
{
Save.CurrentRecord.SetFlag($"Baddy{index}", 1);
}
Save.CurrentRecord.IncFlag(TALK_FLAG);
CheckForDialog();
}
Expand Down
124 changes: 124 additions & 0 deletions Source/Actors/BadelineChase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@

using static Celeste64.Menu;

namespace Celeste64;

public class BadelineChase : Actor, IHaveModels, IHaveSprites, IPickup, ICastPointShadow
{
public SkinnedModel Model;
private readonly Hair hair;
private Color hairColor = 0x9B3FB5;

public float PickupRadius => 9;

public float PointShadowAlpha { get; set; }
private bool drawModel = true;
private bool drawHair = true;
private bool drawOrbs = false;
private float drawOrbsEase = 0;

public BadelineChase()
{
Model = new SkinnedModel(Assets.Models["badeline"]);

foreach (var mat in Model.Materials)
mat.Effects = 0.70f;

PointShadowAlpha = 1;
LocalBounds = new BoundingBox(Vec3.Zero + Vec3.UnitZ * 4, 8);

Model.Flags |= ModelFlags.Silhouette;
Model.Play("Bad.Idle");

foreach (var mat in Model.Materials)
{
if (mat.Name == "Hair")
{
mat.Color = hairColor;
mat.Effects = 0;
}
mat.SilhouetteColor = hairColor;
}

hair = new()
{
Color = hairColor,
ForwardOffsetPerNode = 0,
Nodes = 10
};

drawModel = drawHair = false;
drawOrbs = true;
drawOrbsEase = 1;
Audio.Play(Sfx.sfx_revive, Position);
}

public override void Update()
{
base.Update();

// update model
Model.Transform =
Matrix.CreateScale(3) *
Matrix.CreateTranslation(0, 0, MathF.Sin(World.GeneralTimer * 2) * 1.0f - 1.5f);

// update hair
{
var hairMatrix = Matrix.Identity;
foreach (var it in Model.Instance.Armature.LogicalNodes)
if (it.Name == "Head")
hairMatrix = it.ModelMatrix * SkinnedModel.BaseTranslation * Model.Transform * Matrix;
hair.Flags = Model.Flags;
hair.Forward = -new Vec3(Facing, 0);
hair.Materials[0].Effects = 0;
hair.Update(hairMatrix);
}

if (drawOrbs)
{
drawOrbsEase -= Time.Delta * 2;
if (drawOrbsEase <= 0)
{
drawModel = drawHair = true;
drawOrbs = false;
}
}
}

public void Pickup(Player player)
{
if (!Game.Instance.IsMidTransition)
{
player.Kill();
}
}

public void CollectModels(List<(Actor Actor, Model Model)> populate)
{
if (drawHair)
populate.Add((this, hair));

if (drawModel)
populate.Add((this, Model));
}

public void CollectSprites(List<Sprite> populate)
{
if (drawOrbs && drawOrbsEase > 0)
{
var ease = drawOrbsEase;
var col = Math.Floor(ease * 10) % 2 == 0 ? hair.Color : Color.White;
var s = (ease < 0.5f) ? (0.5f + ease) : (Ease.Cube.Out(1 - (ease - 0.5f) * 2));
for (int i = 0; i < 8; i++)
{
var rot = (i / 8f + ease * 0.25f) * MathF.Tau;
var rad = Ease.Cube.Out(ease) * 16;
var pos = Position + Vec3.UnitZ * 3 + World.Camera.Left * MathF.Cos(rot) * rad + World.Camera.Up * MathF.Sin(rot) * rad;
var size = 3 * s;
populate.Add(Sprite.CreateBillboard(World, pos, "circle", size + 0.5f, Color.Black) with { Post = true });
populate.Add(Sprite.CreateBillboard(World, pos, "circle", size, col) with { Post = true });
}
}
}
}

4 changes: 4 additions & 0 deletions Source/Actors/Granny.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ private CoEnumerator Conversation(Cutscene cs)

int index = Save.CurrentRecord.GetFlag(TALK_FLAG) + 1;
yield return Co.Run(cs.Say(Loc.Lines($"Granny{index}")));
if (Game.Instance.ArchipelagoManager.Friendsanity)
{
Save.CurrentRecord.SetFlag($"Granny{index}", 1);
}
Save.CurrentRecord.IncFlag(TALK_FLAG);
CheckForDialog();
}
Expand Down
10 changes: 9 additions & 1 deletion Source/Actors/IntroCar.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

using System;

namespace Celeste64;

public class IntroCar : Solid
Expand Down Expand Up @@ -87,7 +89,13 @@ public override void Update()
var target = (hasRider ? spawnPoint - Vec3.UnitZ * 1.5f : spawnPoint);
var step = Utils.Approach(Position, target, 20 * Time.Delta);
MoveTo(step);
}

if (hasRider && Game.Instance.ArchipelagoManager.Carsanity)
{
var index = this.scale == 6 ? 1 : 2;
Save.CurrentRecord.SetFlag($"Car{index}", 1);
}
}

public override void CollectModels(List<(Actor Actor, Model Model)> populate)
{
Expand Down
58 changes: 48 additions & 10 deletions Source/Actors/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,14 @@ private bool ClimbCheckAt(Vec3 offset, out WallHit hit)

private bool TryClimb()
{
if (Game.Instance.ArchipelagoManager.MoveShuffle)
{
if (Save.CurrentRecord.GetFlag("Climb") == 0)
{
return false;
}
}

var result = ClimbCheckAt(Vec3.Zero, out var wall);

// let us snap up to walls if we're jumping for them
Expand Down Expand Up @@ -1256,6 +1264,19 @@ private void StNormalUpdate()

private bool TryDash()
{
if (Game.Instance.ArchipelagoManager.MoveShuffle)
{
if (onGround && Save.CurrentRecord.GetFlag("Grounded Dash") == 0)
{
return false;
}

if (!onGround && Save.CurrentRecord.GetFlag("Air Dash") == 0)
{
return false;
}
}

if (dashes > 0 && tDashCooldown <= 0 && Controls.Dash.ConsumePress())
{
dashes--;
Expand Down Expand Up @@ -1397,6 +1418,14 @@ private void StSkiddingExit()

private void StSkiddingUpdate()
{
if (Game.Instance.ArchipelagoManager.MoveShuffle)
{
if (Save.CurrentRecord.GetFlag("Skid Jump") == 0)
{
tNoSkidJump = .1f;
}
}

if (tNoSkidJump > 0)
tNoSkidJump -= Time.Delta;

Expand Down Expand Up @@ -1491,10 +1520,13 @@ private void StClimbingUpdate()
}

if (dashes > 0 && tDashCooldown <= 0 && Controls.Dash.ConsumePress())
{
stateMachine.State = States.Dashing;
dashes--;
return;
{
if (!Game.Instance.ArchipelagoManager.MoveShuffle || Save.CurrentRecord.GetFlag("Air Dash") != 0)
{
stateMachine.State = States.Dashing;
dashes--;
return;
}
}

CancelGroundSnap();
Expand Down Expand Up @@ -1784,9 +1816,12 @@ private void StFeatherStartUpdate()
// dashing
if (dashes > 0 && tDashCooldown <= 0 && Controls.Dash.ConsumePress())
{
stateMachine.State = States.Dashing;
dashes--;
return;
if (!Game.Instance.ArchipelagoManager.MoveShuffle || Save.CurrentRecord.GetFlag("Air Dash") != 0)
{
stateMachine.State = States.Dashing;
dashes--;
return;
}
}
}

Expand Down Expand Up @@ -1891,9 +1926,12 @@ private void StFeatherUpdate()
// dashing
if (dashes > 0 && tDashCooldown <= 0 && Controls.Dash.ConsumePress())
{
stateMachine.State = States.Dashing;
dashes--;
return;
if (!Game.Instance.ArchipelagoManager.MoveShuffle || Save.CurrentRecord.GetFlag("Air Dash") != 0)
{
stateMachine.State = States.Dashing;
dashes--;
return;
}
}

// start climbing
Expand Down
6 changes: 6 additions & 0 deletions Source/Actors/Signpost.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

using System;

namespace Celeste64;

public class Signpost : NPC, IHaveModels
Expand All @@ -25,5 +27,9 @@ private CoEnumerator Talk(Cutscene cs)
{
yield return Co.Run(cs.Face(World.Get<Player>(), Position));
yield return Co.Run(cs.Say(Loc.Lines(Conversation)));
if (Game.Instance.ArchipelagoManager.Signsanity)
{
Save.CurrentRecord.SetFlag(Conversation, 1);
}
}
}
4 changes: 4 additions & 0 deletions Source/Actors/Theo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ private CoEnumerator Conversation(Cutscene cs)

int index = Save.CurrentRecord.GetFlag(TALK_FLAG) + 1;
yield return Co.Run(cs.Say(Loc.Lines($"Theo{index}")));
if (Game.Instance.ArchipelagoManager.Friendsanity)
{
Save.CurrentRecord.SetFlag($"Theo{index}", 1);
}
Save.CurrentRecord.IncFlag(TALK_FLAG);
CheckForDialog();
}
Expand Down
Loading

0 comments on commit 1119813

Please sign in to comment.