Skip to content

Commit

Permalink
qol changes
Browse files Browse the repository at this point in the history
now notifies the player if their inventory is full, slightly tweaked spawn rates with torches, notifies player when they unlock a new character, fixed maul one shotting devil
  • Loading branch information
jeff-j-chen committed Sep 27, 2021
1 parent ffad897 commit 3a3fdbd
Show file tree
Hide file tree
Showing 77 changed files with 1,263 additions and 1,053 deletions.
2 changes: 1 addition & 1 deletion Assets/Scenes/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -3385,7 +3385,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 200, y: 50}
m_SizeDelta: {x: 500, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1301635789
MonoBehaviour:
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ public void Use() {
/// </summary>
private void UseCommon() {
if (Save.game.enemyIsDead || scripts.enemy.enemyName.text is "Tombstone" or "Merchant") {
if (itemName is "steak" or "cheese" or "retry" or "arrow") {
// only allow those 4 items to be used if the enemy is dead, otherwise its a waste
if (itemName is "steak" or "cheese" or "retry" or "arrow" || itemName == "potion" && modifier == "life") {
// only these specific items can be used at a merchant/tombstone, otherwise it doesn't make sense or is a waste
StartCoroutine(UseCommonCoro());
}
}
Expand Down
12 changes: 8 additions & 4 deletions Assets/Scripts/ItemManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.TextCore.Text;
public class ItemManager : MonoBehaviour {
[SerializeField] public TextMeshProUGUI lootText;
[SerializeField] public TextMeshProUGUI itemDesc;
Expand Down Expand Up @@ -309,9 +310,8 @@ public void GiveStarterItems() {
switch (Save.game.curCharNum) {
// new game, so give the base weapons
case 0: {
// CreateWeaponWithStats("sword", "harsh", 2, 2, 1, 2);
CreateWeaponWithStats("sword", "harsh", 2, 2, 1, 2);
// CreateWeaponWithStats("sword", "administrative", 10, 10, 10, 10);
// CreateWeaponWithStats("maul", "administrative", 10, 10, 10, 10);
MoveToInventory(0, true, false, false);
CreateItem("steak");
MoveToInventory(0, true, false, false);
Expand Down Expand Up @@ -503,7 +503,8 @@ public GameObject CreateItem(string itemName, string modifier, int negativeOffse
private void SetItemStatsImmediately(GameObject instantiatedItem) {
// this needs to be done here rather than in Item.Start() or Awake() because the timing will be off and errors will be thrown
if (instantiatedItem.GetComponent<Item>().itemName == "necklet") {
instantiatedItem.GetComponent<Item>().modifier = neckletTypes[Random.Range(0, 5)];
int rand = Random.Range(0, 5);
instantiatedItem.GetComponent<Item>().modifier = neckletTypes[rand];
}
else if (instantiatedItem.GetComponent<Item>().itemName == "scroll") {
instantiatedItem.GetComponent<Item>().modifier = scrollTypes[Random.Range(0, scrollTypes.Length)];
Expand Down Expand Up @@ -714,6 +715,9 @@ public void MoveToInventory(int index, bool starter=false, bool playAudio=true,
// attempt to select the next item of where it was
}
}
else {
scripts.turnManager.SetStatusText("you can't carry any more");
}
}
else {
Destroy(floorItems[index]);
Expand Down Expand Up @@ -758,7 +762,7 @@ public void SpawnItems() {
int torchCount = (from item in scripts.player.inventory where item.GetComponent<Item>().itemName == "torch" select item).Count();
if (PlayerHasWeapon("sword") && PlayerHasLegendary()) { torchCount++; }
// count the number of torches, legendary sword helps find loot
int spawnCount = Mathf.Clamp(torchCount + scripts.levelManager.level + 1 + Random.Range(-2, 1), 0, 6);
int spawnCount = Mathf.Clamp(Random.Range(1, torchCount+1) + scripts.levelManager.level + 1 + Random.Range(-2, 1), 0, 6);
// create a spawn count, only 5 items can be spawned
CreateRandomWeapon();
// create a random weapon at index 0
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/ItemManager.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 25 additions & 5 deletions Assets/Scripts/LevelManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,20 @@ private IEnumerator NextLevelCoroutine(bool isLich=false) {
if (level == 4 && sub == 1) {
if (debugGlitchCoro != null) { StopCoroutine(debugGlitchCoro); }
// going to next level after having defeated devil
if (Save.game.curCharNum != 3) {
// give player the next character, as long as they aren't on the last one\
if (Save.game.curCharNum != 3 && !Save.persistent.unlockedChars[Save.game.curCharNum + 1]) {
// unlock the next character and let them know if it has not yet been unlocked
StartCoroutine(IndicateUnlock());
Save.persistent.unlockedChars[Save.game.curCharNum + 1] = true;
Save.persistent.successfulRuns++;
Save.SavePersistent();
}
print("notify the player they unlocked a new character to play here!");
else {
Initiate.Fade("Credits", Color.black, 2.5f);
}
Save.game = new GameData();
if (scripts.tutorial == null) { Save.SaveGame(); }
// for some reason file.delete doesn't want to work here
Initiate.Fade("Credits", Color.black, 2.5f);
// load credits scene
yield break;
}
scripts.turnManager.ClearVariablesAfterRound();
// remove variables before going to next level
Expand Down Expand Up @@ -351,6 +353,24 @@ private char T() {
return thinCharacters[UnityEngine.Random.Range(0, thinCharacters.Length)];
}

private IEnumerator IndicateUnlock() {
// fade in the black box, let the player know that they unlocked a new character, then go to credits
Color tempColor = boxSR.color;
tempColor.a = 0f;
boxSR.color = tempColor;
for (int i = 0; i < 15; i++) {
yield return scripts.delays[0.033f];
tempColor.a += 1f/15f;
boxSR.color = tempColor;
}
loadingCircle.transform.position = onScreen;
levelTransText.text = "New character unlocked!";
yield return scripts.delays[2f];
levelTransText.text = "";
loadingCircle.transform.position = offScreen;
Initiate.Fade("Credits", Color.black, 4f);
}

/// <summary>
/// Create the glitchy effect that the text has when going to 4-1 (Devil).
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/StatSummoner.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions Assets/Scripts/TurnManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ public void SetTargetOf(string playerOrEnemy) {
if (scripts.enemy.woundList.Contains(targetArr[scripts.player.targetIndex])) { scripts.player.target.text = "*" + targetArr[scripts.player.targetIndex]; }
// add an asterisks if already injured
else {
if (targetArr[scripts.player.targetIndex] == "face") {
// can't aim at the devil's face, so notify player
if (targetArr[scripts.player.targetIndex] == "face" && !Save.game.enemyIsDead) {
// can't aim at the devil's face if hes alive, so notify player
scripts.turnManager.SetStatusText("you cannot aim at his face");
scripts.player.targetIndex--;
}
Expand Down Expand Up @@ -951,7 +951,7 @@ private bool PlayerAttacks() {
if (scripts.itemManager.PlayerHasWeapon("maul")) {}
// don't say anything for maul (we want it to show that it is an instant kill)
else if (scripts.enemy.spawnNum == 0) {}
// don't say anything for cloaked devil (shattering his cloak handlded later on)
// don't say anything for cloaked devil (shattering his cloak handled later on)
else {
SetStatusText($"you hit {scripts.enemy.enemyName.text.ToLower()}, damaging {scripts.player.target.text}!");
}
Expand Down Expand Up @@ -986,7 +986,10 @@ private bool PlayerAttacks() {
// make the text change
RecalculateMaxFor("enemy");
// recalculate max
return ApplyInjuriesDuringMove(scripts.player.target.text, "enemy");
if (scripts.enemy.spawnNum != 0) {
// cloaked devil is unaffected by all wounds
return ApplyInjuriesDuringMove(scripts.player.target.text, "enemy");
}
// return if the enemy dies and at the same time apply wounds instantly

}
Expand Down
Binary file modified Library/ArtifactDB
Binary file not shown.
Binary file modified Library/ArtifactDB-lock
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Library/Bee/2400b0aE.dag
Binary file not shown.
Binary file modified Library/Bee/2400b0aE.dag_fsmtime
Binary file not shown.
Binary file modified Library/Bee/TundraBuildState.state
Binary file not shown.
Binary file modified Library/Bee/TundraBuildState.state.map
Binary file not shown.
Binary file modified Library/Bee/artifacts/2400b0aE.dag/Assembly-CSharp.dll
Binary file not shown.
Binary file modified Library/Bee/artifacts/2400b0aE.dag/Assembly-CSharp.pdb
Binary file not shown.
Binary file modified Library/Bee/artifacts/2400b0aE.dag/Assembly-CSharp.ref.dll
Binary file not shown.
Loading

0 comments on commit 3a3fdbd

Please sign in to comment.