Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
NPBruce committed Mar 24, 2017
2 parents 63121f2 + 0883014 commit 6da1dad
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Assets/Resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.0
0.7.1
2 changes: 1 addition & 1 deletion Assets/Scripts/Quest/EventManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void TriggerEvent()
Quest.Monster oldMonster = null;
foreach (Quest.Monster m in game.quest.monsters)
{
if (m.monsterData.name.Equals(qe.cMonster.name))
if (m.monsterData.sectionName.Equals(qe.cMonster.sectionName))
{
// Matched existing monster
oldMonster = m;
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/Quest/HeroDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public void CreateWindow()
// Is this hero defeated?
if (hero.defeated)
{
new TextButton(new Vector2(HeroCanvas.heroSize + 0.5f, offset + 2.5f), new Vector2(10, 2), "Restored", delegate { restored(); });
new TextButton(new Vector2(HeroCanvas.heroSize + 0.5f, offset + 2.5f), new Vector2(10, 2), "Recover", delegate { restored(); });
}
else
{
new TextButton(new Vector2(HeroCanvas.heroSize + 0.5f, offset + 2.5f), new Vector2(10, 2), "Defeated", delegate { defeated(); });
new TextButton(new Vector2(HeroCanvas.heroSize + 0.5f, offset + 2.5f), new Vector2(10, 2), "KO", delegate { defeated(); });
}

new TextButton(new Vector2(HeroCanvas.heroSize + 0.5f, offset + 5f), new Vector2(10, 2), "Cancel", delegate { onCancel(); });
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Quest/InfoDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public InfoDialog(Quest.Monster m)
db = new DialogBox(new Vector2(12, 13f), new Vector2(UIScaler.GetWidthUnits() - 24, 2), m.uniqueTitle, Color.red);
db.textObj.GetComponent<UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont();
db.AddBorder();
db = new DialogBox(new Vector2(10, 15f), new Vector2(UIScaler.GetWidthUnits() - 20, 8), m.uniqueText.Replace("\\n", "\n"));
db = new DialogBox(new Vector2(10, 15f), new Vector2(UIScaler.GetWidthUnits() - 20, 8), EventManager.SymbolReplace(m.uniqueText.Replace("\\n", "\n")));
db.AddBorder(Color.red);
new TextButton(new Vector2(UIScaler.GetWidthUnits() - 21, 23.5f), new Vector2(10, 2), "Close", delegate { onClose(); });
}
Expand Down
12 changes: 6 additions & 6 deletions Assets/Scripts/Quest/Quest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,12 @@ public Monster(EventManager.MonsterEvent monsterEvent)
}
}

// Create new activation
public void NewActivation(ActivationData contentActivation)
{
currentActivation = new ActivationInstance(contentActivation, monsterData.name.Translate());
}

// Construct from save data
public Monster(Dictionary<string, string> data)
{
Expand Down Expand Up @@ -989,12 +995,6 @@ public Monster(Dictionary<string, string> data)
}
}

// Create new activation
public void NewActivation(ActivationData contentActivation)
{
currentActivation = new ActivationInstance(contentActivation, monsterData.name.Translate());
}

// Activation instance is requresd to track variables in the activation
public class ActivationInstance
{
Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/Quest/QuestMonster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,6 @@ public QuestActivation(QuestData.Activation qa) : base()
masterFirst = qa.masterFirst;
move = new StringKey(EventManager.SymbolReplace(qa.move.key), false);
moveButton = new StringKey(EventManager.SymbolReplace(qa.moveButton.key), false);
sectionName = qa.sectionName;
}
}
24 changes: 21 additions & 3 deletions Assets/Scripts/QuestEditor/QuestEditorData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,13 @@ public void NewTile()
{
index++;
}
game.quest.qd.components.Add("Tile" + index, new QuestData.Tile("Tile" + index));
QuestData.Tile tile = new QuestData.Tile("Tile" + index);
game.quest.qd.components.Add("Tile" + index, tile);

CameraController cc = GameObject.FindObjectOfType<CameraController>();
tile.location.x = game.gameType.TileRound() * Mathf.Round(cc.gameObject.transform.position.x / game.gameType.TileRound());
tile.location.y = game.gameType.TileRound() * Mathf.Round(cc.gameObject.transform.position.y / game.gameType.TileRound());

game.quest.Add("Tile" + index);
SelectComponent("Tile" + index);
}
Expand All @@ -587,7 +593,13 @@ public void NewDoor()
{
index++;
}
game.quest.qd.components.Add("Door" + index, new QuestData.Door("Door" + index));
QuestData.Door door = new QuestData.Door("Door" + index);
game.quest.qd.components.Add("Door" + index, door);

CameraController cc = GameObject.FindObjectOfType<CameraController>();
door.location.x = game.gameType.SelectionRound() * Mathf.Round(cc.gameObject.transform.position.x / game.gameType.SelectionRound());
door.location.y = game.gameType.SelectionRound() * Mathf.Round(cc.gameObject.transform.position.y / game.gameType.SelectionRound());

game.quest.Add("Door" + index);
SelectComponent("Door" + index);
}
Expand All @@ -601,7 +613,13 @@ public void NewToken()
{
index++;
}
game.quest.qd.components.Add("Token" + index, new QuestData.Token("Token" + index));
QuestData.Token token = new QuestData.Token("Token" + index);
game.quest.qd.components.Add("Token" + index, token);

CameraController cc = GameObject.FindObjectOfType<CameraController>();
token.location.x = game.gameType.SelectionRound() * Mathf.Round(cc.gameObject.transform.position.x / game.gameType.SelectionRound());
token.location.y = game.gameType.SelectionRound() * Mathf.Round(cc.gameObject.transform.position.y / game.gameType.SelectionRound());

game.quest.Add("Token" + index);
SelectComponent("Token" + index);
}
Expand Down
3 changes: 2 additions & 1 deletion Assets/Scripts/SaveManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ public static void Load()
game.stageUI = new NextStageButton();
}
}
catch (System.Exception)
catch (System.Exception e)
{
e = e;
ValkyrieDebug.Log("Error: Unable to open save file: " + SaveFile());
Application.Quit();
}
Expand Down

0 comments on commit 6da1dad

Please sign in to comment.