本文整理汇总了C#中Combat.Phase方法的典型用法代码示例。如果您正苦于以下问题:C# Combat.Phase方法的具体用法?C# Combat.Phase怎么用?C# Combat.Phase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Combat
的用法示例。
在下文中一共展示了Combat.Phase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildCombatDebugWindow
public GuiObject BuildCombatDebugWindow(IFightable friend, IFightable enemy, Combat combat) {
CloseWindow("LeftPane");
GuiObject window = new GuiObject(new Rect(20, 50, 800, 500), "CentrePane", "Combat!");
Status friendStatus = friend.GetStatus(), enemyStatus = enemy.GetStatus();
combat = new Combat(friend, enemy);
window.AddChild(new GuiObject( new Rect(20, 20, 800, 100),
(g) => {
GUI.Label(new Rect(10, 25, 780, 100), "Night has fallen, you are under attack!");
if (GUI.Button(new Rect(345, 65, 100, 30), "Attack!")) {
combat.Phase();
}
}, "Text", ""));
window.AddChild(new GuiObject(new Rect(20, 100, 360, 390),
(g) => {
GUI.Box(g.rect, g.text);
GUI.Label(new Rect(30, 200, 200, 25), "Attack: " + friendStatus.attack);
if (friendStatus.attackbonus > 0f) {
SetColor(() => true);
GUI.Label(new Rect(90, 200, 200, 25), "+" + friendStatus.attackbonus);
SetColor();
}
GUI.Label(new Rect(30, 220, 200, 25), "Armour: " + friendStatus.armour);
if (friendStatus.armorbonus > 0f) {
SetColor(() => true);
GUI.Label(new Rect(90, 220, 200, 25), "+" + friendStatus.armorbonus);
SetColor();
}
GUI.Label(new Rect(30, 240, 200, 25), "Speed: " + friendStatus.speed);
if (friendStatus.speedbonus > 0f) {
SetColor(() => true);
GUI.Label(new Rect(90, 240, 200, 25), "+" + friendStatus.speedbonus);
SetColor();
}
GUI.Label(new Rect(130, 200, 100, 25), "Health: " + friendStatus.health);
GUI.Label(new Rect(130, 220, 100, 25), "Turn: " + friendStatus.turn);
}, "FriendBox", "Friend"));
window.AddChild(new GuiObject(new Rect(410, 100, 360, 390),
(g) => {
GUI.Box(g.rect, g.text);
GUI.Label(new Rect(420, 200, 200, 25), "Attack: " + enemyStatus.attack);
if (enemyStatus.attackbonus > 0f) {
SetColor(() => true);
GUI.Label(new Rect(480, 200, 200, 25), "+" + enemyStatus.attackbonus);
SetColor();
}
GUI.Label(new Rect(420, 220, 200, 25), "Armour: " + enemyStatus.armour);
if (enemyStatus.armorbonus > 0f) {
SetColor(() => true);
GUI.Label(new Rect(480, 220, 200, 25), "+" + enemyStatus.armorbonus);
SetColor();
}
GUI.Label(new Rect(420, 240, 200, 25), "Speed: " + enemyStatus.speed);
if (enemyStatus.speedbonus > 0f) {
SetColor(() => true);
GUI.Label(new Rect(480, 240, 200, 25), "+" + enemyStatus.speedbonus);
SetColor();
}
GUI.Label(new Rect(520, 200, 100, 25), "Health: " + enemyStatus.health);
GUI.Label(new Rect(520, 220, 100, 25), "Turn: " + enemyStatus.turn);
}, "EnemyBox", "Enemy"));
return window;
}
示例2: BuildCombatWindow
public GuiObject BuildCombatWindow(IFightable friend, IFightable enemy, Combat combat) {
CloseWindow("LeftPane");
GuiObject window = new GuiObject(new Rect(100, 50, 400, 300), "CentrePane", "Combat!");
Status friendStatus = friend.GetStatus(), enemyStatus = enemy.GetStatus();
combat = new Combat(friend, enemy);
string report = combat.Phase()();
window.AddChild(new GuiObject(new Rect(10, 25, 490, 370),
(g) => {
GUI.Label(g.rect, "Night has fallen and you were attacked!\n" + report);
if (GUI.Button(new Rect(175, 260, 50, 25), "OK")) {
CloseWindow("CentrePane");
}
}, "Report", ""));
return window;
}