当前位置: 首页>>代码示例>>C#>>正文


C# Combat.Phase方法代码示例

本文整理汇总了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;
	}
开发者ID:NotYours180,项目名称:Survival,代码行数:68,代码来源:TreeGUIRenderer.cs

示例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;
	}
开发者ID:NotYours180,项目名称:Survival,代码行数:17,代码来源:TreeGUIRenderer.cs


注:本文中的Combat.Phase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。