Skip to content

Commit

Permalink
v1.6.6.1-beta release
Browse files Browse the repository at this point in the history
  • Loading branch information
ipodtouch0218 committed Jul 12, 2022
1 parent a5414e6 commit babb64f
Show file tree
Hide file tree
Showing 14 changed files with 540 additions and 534 deletions.
4 changes: 2 additions & 2 deletions Assets/Resources/Fonts/UISymbols.asset
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,9 @@ MonoBehaviour:
m_Metrics:
m_Width: 13
m_Height: 13
m_HorizontalBearingX: -2
m_HorizontalBearingX: 0
m_HorizontalBearingY: 13
m_HorizontalAdvance: 17
m_HorizontalAdvance: 12
m_GlyphRect:
m_X: 78
m_Y: 56
Expand Down
1 change: 0 additions & 1 deletion Assets/Resources/Prefabs/Powerup/IceFlower.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ MonoBehaviour:
bouncePower: 0
terminalVelocity: 8
blinkingRate: 6
passthrough: 1
avoidPlayers: 0
followMe: {fileID: 0}
followMeCounter: 0
Expand Down
2 changes: 1 addition & 1 deletion Assets/Resources/Prefabs/Static/CloudPlatform.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Transform:
m_GameObject: {fileID: 8010249587145537848}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.2, y: 1, z: 0}
m_LocalScale: {x: 1.44, y: 0.94031227, z: 1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8010249587262149990}
Expand Down
11 changes: 6 additions & 5 deletions Assets/Scenes/Levels/DefaultCastle.unity
Original file line number Diff line number Diff line change
Expand Up @@ -3939,7 +3939,7 @@ GameObject:
- component: {fileID: 361225205}
m_Layer: 8
m_Name: Tilemap_Squishy
m_TagString: Untagged
m_TagString: Squishy
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
Expand Down Expand Up @@ -4181,7 +4181,7 @@ Tilemap:
second:
serializedVersion: 2
m_TileIndex: 6
m_TileSpriteIndex: 10
m_TileSpriteIndex: 6
m_TileMatrixIndex: 0
m_TileColorIndex: 0
m_TileObjectToInstantiateIndex: 65535
Expand Down Expand Up @@ -11268,8 +11268,9 @@ Tilemap:
- m_RefCount: 56
m_Data: {fileID: -4555241164079809555, guid: 437a8c91bf200d54b838bc8c861ba57c,
type: 3}
- m_RefCount: 0
m_Data: {fileID: 0}
- m_RefCount: 1
m_Data: {fileID: 8220105646016656977, guid: 437a8c91bf200d54b838bc8c861ba57c,
type: 3}
- m_RefCount: 1
m_Data: {fileID: 2755618445371018580, guid: 437a8c91bf200d54b838bc8c861ba57c,
type: 3}
Expand All @@ -11279,7 +11280,7 @@ Tilemap:
- m_RefCount: 504
m_Data: {fileID: -5379535959924532667, guid: 437a8c91bf200d54b838bc8c861ba57c,
type: 3}
- m_RefCount: 48
- m_RefCount: 47
m_Data: {fileID: 9027231124237481164, guid: 437a8c91bf200d54b838bc8c861ba57c,
type: 3}
- m_RefCount: 5
Expand Down
983 changes: 493 additions & 490 deletions Assets/Scenes/MainMenu.unity

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Assets/Scripts/Entity/FireballMover.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void Start() {

object[] data = photonView.InstantiationData;
left = (bool) data[0];
if (data.Length > 1)
if (data.Length > 1 && isIceball)
speed += Mathf.Abs((float) data[1] / 3f);

body.velocity = new Vector2(speed * (left ? -1 : 1), -speed);
Expand Down
26 changes: 14 additions & 12 deletions Assets/Scripts/Entity/Player/PlayerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Photon.Pun;
using ExitGames.Client.Photon;
using TMPro;
using UnityEngine.SceneManagement;

public class PlayerController : MonoBehaviourPun, IFreezableEntity, ICustomSerializeView, IOnPhotonViewPreNetDestroy {

Expand Down Expand Up @@ -721,7 +722,7 @@ private void ActivatePowerupAction() {
if (Utils.IsTileSolidAtWorldLocation(pos)) {
photonView.RPC("SpawnParticle", RpcTarget.All, $"Prefabs/Particle/{projectile}Wall", pos);
} else {
PhotonNetwork.Instantiate($"Prefabs/{projectile}", pos, Quaternion.identity, 0, new object[] { !facingRight ^ animator.GetCurrentAnimatorStateInfo(0).IsName("turnaround") });
PhotonNetwork.Instantiate($"Prefabs/{projectile}", pos, Quaternion.identity, 0, new object[] { !facingRight ^ animator.GetCurrentAnimatorStateInfo(0).IsName("turnaround"), body.velocity.x });
}
photonView.RPC("PlaySound", RpcTarget.All, sound);

Expand Down Expand Up @@ -1692,27 +1693,27 @@ void HandleCrouching(bool crouchInput) {
return;
}
bool prevCrouchState = crouching || groundpound;
crouching = ((onGround && crouchInput && !groundpound) || (!onGround && crouchInput && crouching) || ForceCrouchCheck()) && !holding;
crouching = ((onGround && crouchInput && !groundpound) || (!onGround && crouchInput && crouching) || (crouching && ForceCrouchCheck())) && !holding;
if (crouching && !prevCrouchState) {
//crouch start sound
photonView.RPC("PlaySound", RpcTarget.All, state == Enums.PowerupState.BlueShell ? Enums.Sounds.Powerup_BlueShell_Enter : Enums.Sounds.Player_Sound_Crouch);
}
}

bool ForceCrouchCheck() {
if (!(state == Enums.PowerupState.BlueShell && (crouching || groundpound || inShell) && !onGround))
if (state == Enums.PowerupState.BlueShell && onGround && SceneManager.GetActiveScene().buildIndex != 4)
return false;
if (state <= Enums.PowerupState.MiniMushroom)
return false;

float width = MainHitbox.bounds.extents.x;

//bool triggerState = Physics2D.queriesHitTriggers;
//Physics2D.queriesHitTriggers = false;
bool triggerState = Physics2D.queriesHitTriggers;
Physics2D.queriesHitTriggers = false;

bool ret = Physics2D.BoxCast(body.position + Vector2.up * 0.025f, new(width + 0.05f, 0.05f), 0, Vector2.up, MainHitbox.size.y * 2f, ONLY_GROUND_MASK);
bool ret = Physics2D.BoxCast(body.position + Vector2.up * 0.1f, new(width - 0.05f, 0.05f), 0, Vector2.up, MainHitbox.size.y * 2f, ONLY_GROUND_MASK);

//Physics2D.queriesHitTriggers = triggerState;
Physics2D.queriesHitTriggers = triggerState;
return ret;
}

Expand Down Expand Up @@ -1994,7 +1995,7 @@ bool HandleStuckInBlock() {
Vector2 checkSize = MainHitbox.size * transform.lossyScale * new Vector2(1, 0.75f);
Vector2 checkPos = transform.position + (Vector3) (Vector2.up * checkSize / 2f);

if (!Utils.IsAnyTileSolidBetweenWorldBox(checkPos, checkSize * 0.9f)) {
if (!Utils.IsAnyTileSolidBetweenWorldBox(checkPos, checkSize * 0.9f, false)) {
stuckInBlock = false;
return false;
}
Expand All @@ -2012,11 +2013,11 @@ bool HandleStuckInBlock() {
bool orig = Physics2D.queriesStartInColliders;
Physics2D.queriesStartInColliders = false;

var hitTop = Physics2D.BoxCast(body.position + (size.y + 0.5f) * Vector2.up, new(size.x, 0.01f), 0, Vector2.down, size.y + 0.5f, ONLY_GROUND_MASK);
var hitTop = Physics2D.BoxCast(body.position + (size.y + 0.75f) * Vector2.up, new(size.x, 0.01f), 0, Vector2.down, size.y + 0.75f, ONLY_GROUND_MASK);

if (hitTop) {
Vector2 newPoint = new(body.position.x, hitTop.point.y);
if (hitTop.point.y > body.position.y && hitTop.point.y < body.position.y + MainHitbox.size.y && !Utils.IsTileSolidAtWorldLocation(newPoint + Vector2.up * 0.25f)) {
if (hitTop.point.y > body.position.y && hitTop.point.y < body.position.y + (size.y + 0.35f) && !Utils.IsTileSolidAtWorldLocation(newPoint + Vector2.up * 0.25f)) {
transform.position = body.position = newPoint;
} else {
var hitBottom = Physics2D.BoxCast(body.position, new(size.x, 0.01f), 0, Vector2.down, size.y, ONLY_GROUND_MASK);
Expand Down Expand Up @@ -2461,10 +2462,11 @@ void HandleMovement(float delta) {
}
}

if (!inShell && !(sliding && Mathf.Abs(floorAngle) > slopeSlidingAngle * 2)) {
bool uphill = sliding && (floorAngle != 0 && Mathf.Sign(floorAngle) == Mathf.Sign(body.velocity.x));
if (!inShell && !(sliding && Mathf.Abs(floorAngle) > slopeSlidingAngle * 2 && !uphill)) {
bool abovemax = false;
float invincibleSpeedBoost = invincible > 0 ? 1.5f : 1;
float uphillChange = (floorAngle != 0 && Mathf.Sign(floorAngle) == Mathf.Sign(body.velocity.x)) ? (1 - (Mathf.Abs(floorAngle) / 360f)) : 1;
float uphillChange = uphill ? (1 - (Mathf.Abs(floorAngle) / 360f)) : 1;
float max;
if (onGround) {
max = functionallyRunning ? runningMaxSpeed * invincibleSpeedBoost : walkingMaxSpeed;
Expand Down
13 changes: 5 additions & 8 deletions Assets/Scripts/Entity/StarBouncer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ public class StarBouncer : MonoBehaviourPun {

private BoxCollider2D worldCollider;

private int? becomeCollectibleAt = null;
private bool alreadyCollectible, canBounce;
private bool collectable, canBounce;

void Start() {
body = GetComponent<Rigidbody2D>();
Expand All @@ -44,9 +43,6 @@ void Start() {
left = direction <= 1;
fast = direction == 0 || direction == 3;
creator = (int) data[1];
becomeCollectibleAt = (int) data[2];
if (becomeCollectibleAt < PhotonNetwork.ServerTimestamp)
alreadyCollectible = true;
body.velocity = new Vector2(moveSpeed * (left ? -1 : 1), deathBoostAmount);
if ((bool) data[3]) {
body.velocity += Vector2.up * 3;
Expand All @@ -55,10 +51,9 @@ void Start() {
worldCollider.enabled = true;
} else {
GetComponent<Animator>().enabled = true;
alreadyCollectible = true;
collectable = true;
body.isKinematic = true;
body.velocity = Vector2.zero;
becomeCollectibleAt = PhotonNetwork.ServerTimestamp;
GetComponent<CustomRigidbodySerializer>().enabled = false;

if (GameManager.Instance.musicEnabled)
Expand Down Expand Up @@ -97,7 +92,9 @@ void FixedUpdate() {
return;

body.velocity = new Vector2(moveSpeed * (left ? -1 : 1) * (fast ? 1.5f : 1f), body.velocity.y);

canBounce |= body.velocity.y < 0;
collectable |= body.velocity.y < 0;

HandleCollision();

Expand Down Expand Up @@ -148,6 +145,6 @@ public void Turnaround(bool hitLeft) {
}

public bool IsCollectible() {
return becomeCollectibleAt == null || alreadyCollectible || PhotonNetwork.ServerTimestamp - becomeCollectibleAt > 0;
return collectable;
}
}
4 changes: 2 additions & 2 deletions Assets/Scripts/Networking/UpdateChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public async static void IsUpToDate(Action<bool, string> callback) {


try {
bool ret = false;
bool ret = true;

//get the latest release version number from github
string json = new StreamReader(response.GetResponseStream()).ReadToEnd();
Expand Down Expand Up @@ -55,7 +55,7 @@ public async static void IsUpToDate(Action<bool, string> callback) {
if (local == remote)
continue;

ret = local > remote;
ret &= local >= remote;
}

callback(ret, tag);
Expand Down
4 changes: 3 additions & 1 deletion Assets/Scripts/UI/Menu/MainMenuManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,12 @@ public void OpenPrivatePrompt() {
EventSystem.current.SetSelectedGameObject(privateSelected);
}
public void OpenErrorBox(string text) {
if (!errorBox.activeSelf)
sfx.PlayOneShot(Enums.Sounds.UI_Error.GetClip());

errorBox.SetActive(true);
errorText.text = text;
EventSystem.current.SetSelectedGameObject(errorButton);
sfx.PlayOneShot(Enums.Sounds.UI_Error.GetClip());
}

public void BackSound() {
Expand Down
7 changes: 4 additions & 3 deletions Assets/Scripts/UI/Menu/RoomIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ public void UpdateUI(RoomInfo newRoom) {
string symbols = "";
Utils.GetCustomProperty(Enums.NetRoomProperties.StarRequirement, out int stars, newRoom.CustomProperties);
Utils.GetCustomProperty(Enums.NetRoomProperties.CoinRequirement, out int coins, newRoom.CustomProperties);
bool lives = ((int) prop[Enums.NetRoomProperties.Lives]) >= 1;
Utils.GetCustomProperty(Enums.NetRoomProperties.Lives, out int lives, newRoom.CustomProperties);
bool powerups = (bool) prop[Enums.NetRoomProperties.NewPowerups];
bool time = ((int) prop[Enums.NetRoomProperties.Time]) >= 1;
//bool password = ((string) prop[Enums.NetRoomProperties.Password]) != "";

if (lives)
symbols += "<sprite=9>";
if (powerups)
symbols += "<sprite=8>";
if (time)
symbols += "<sprite=6>";

if (lives >= 1)
symbols += "<sprite=9>" + Utils.GetSymbolString(lives.ToString(), Utils.smallSymbols);

symbols += "<sprite=38>" + Utils.GetSymbolString(stars.ToString(), Utils.smallSymbols);
symbols += "<sprite=37>" + Utils.GetSymbolString(coins.ToString(), Utils.smallSymbols);
//if (password)
Expand Down
15 changes: 8 additions & 7 deletions Assets/Scripts/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ private static Tile.ColliderType GetColliderType(Vector3Int tileLocation) {
return Tile.ColliderType.None;
}

public static bool IsTileSolidBetweenWorldBox(Vector3Int tileLocation, Vector2 worldLocation, Vector2 worldBox) {
Collider2D collision = Physics2D.OverlapPoint(worldLocation, LayerMask.GetMask("Ground"));
if (collision && !collision.isTrigger && !collision.CompareTag("Player"))
return true;
public static bool IsTileSolidBetweenWorldBox(Vector3Int tileLocation, Vector2 worldLocation, Vector2 worldBox, bool boxcast = true) {
if (boxcast) {
Collider2D collision = Physics2D.OverlapPoint(worldLocation, LayerMask.GetMask("Ground"));
if (collision && !collision.isTrigger && !collision.CompareTag("Player"))
return true;
}

Vector2 ogWorldLocation = worldLocation;
Vector3Int ogTileLocation = tileLocation;
while (GetTileAtTileLocation(tileLocation) is TileInteractionRelocator it) {
worldLocation += (Vector2)(Vector3) it.offset * 0.5f;
tileLocation += it.offset;
Expand Down Expand Up @@ -337,7 +338,7 @@ static bool IsInside(List<Vector2> polygon, Vector2 p) {
return (count % 2 == 1); // Same as (count%2 == 1)
}

public static bool IsAnyTileSolidBetweenWorldBox(Vector2 checkPosition, Vector2 checkSize) {
public static bool IsAnyTileSolidBetweenWorldBox(Vector2 checkPosition, Vector2 checkSize, bool boxcast = true) {
Vector3Int minPos = WorldToTilemapPosition(checkPosition - (checkSize / 2), wrap: false);
Vector3Int size = WorldToTilemapPosition(checkPosition + (checkSize / 2), wrap: false) - minPos;

Expand All @@ -347,7 +348,7 @@ public static bool IsAnyTileSolidBetweenWorldBox(Vector2 checkPosition, Vector2
Vector3Int tileLocation = new(minPos.x + x, minPos.y + y, 0);
WrapTileLocation(ref tileLocation);

if (IsTileSolidBetweenWorldBox(tileLocation, checkPosition, checkSize))
if (IsTileSolidBetweenWorldBox(tileLocation, checkPosition, checkSize, boxcast))
return true;
}
}
Expand Down
Binary file modified Assets/Sprites/UI/ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 1.6.6.0-beta
bundleVersion: 1.6.6.1-beta
preloadedAssets:
- {fileID: 0}
- {fileID: 0}
Expand Down

0 comments on commit babb64f

Please sign in to comment.