本文整理汇总了C#中Battle类的典型用法代码示例。如果您正苦于以下问题:C# Battle类的具体用法?C# Battle怎么用?C# Battle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Battle类属于命名空间,在下文中一共展示了Battle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AttackCustomWindow
public AttackCustomWindow(Battle battle)
{
InitializeComponent();
_battle = battle;
comboBox1.ItemsSource = _battle.Members;
comboBox2.ItemsSource = _battle.Members;
}
示例2: BattleScreen
/// <summary>
/// Constructor.
/// </summary>
public BattleScreen(Battle.BattleInfo battleInfo)
{
TransitionOnTime = TimeSpan.FromSeconds(1.5);
TransitionOffTime = TimeSpan.FromSeconds(0.5);
BattleInfo = battleInfo;
}
示例3: Think
public Think(Battle battle)
: base(battle)
{
CurrentThinkActionType = ThinkActionType.None;
currentThinkAction = null;
CurrentOptionNameIndex = 0;
MenuOptions = null;
inOuterMenu = true;
CurrentOuterMenuOptionIndex = 0;
weaponMenuOptions = new Dictionary<CharacterClass, List<ThinkMenuOption>>();
foreach (CharacterClass characterClass in Enum.GetValues(typeof(CharacterClass)))
weaponMenuOptions.Add(characterClass, new List<ThinkMenuOption>());
shieldMenuOptions = new List<ThinkMenuOption>();
itemMenuOptions = new List<ThinkMenuOption>();
Actions = new List<ThinkAction>(battle.PlayerParty.Count);
inputButtonListener = new InputButtonListener(new Dictionary<InputButton, ButtonEventHandlers> {
{ InputButton.Up, new ButtonEventHandlers(down: upHandler) },
{ InputButton.Down, new ButtonEventHandlers(down: downHandler) },
{ InputButton.Left, new ButtonEventHandlers(down: leftHandler) },
{ InputButton.Right, new ButtonEventHandlers(down: rightHandler) },
{ InputButton.A, new ButtonEventHandlers(up: selectOption) },
{ InputButton.B, new ButtonEventHandlers(up: cancelAction) }
});
}
示例4: TryPerform
public bool TryPerform(Battle context)
{
Debug.Assert(!IsRunning);
if (IsBeforeDelaying)
{
Debug.LogError("now before delaying.");
return false;
}
if (_boss.IsDead)
return false;
if (_boss.Data.Skills.Empty())
{
Debug.LogError("has no skill.");
return false;
}
var data = SampleOrGetDebugSkillData(context);
if (data == null)
return false;
Running = _skillFactory.Create(data, context, _boss);
Running.OnStop += OnStop;
Running.Start();
Events.Boss.OnSkillStart.CheckAndCall(_boss, Running);
return true;
}
示例5: Encounter
public override void Encounter()
{
int level = rng.Next(3, 5);
int species = rng.Next(1, 101);
Battle battle = new Battle();
if (species > 65)
{
battle.Wild(generator.Create("Rattata", level));
}
else if (species > 30)
{
battle.Wild(generator.Create("Pidgey", level));
}
else if (species > 15)
{
battle.Wild(generator.Create("Weedle", level));
}
else
{
battle.Wild(generator.Create("Caterpie", level));
}
return;
}
示例6: Interact
public override void Interact(Entity other)
{
if (other is Combatant) {
Combatant otherCombatant = (Combatant)other;
// If interacting with an enemy
if (!Team.IsFriendly(otherCombatant.Team)) {
IsEngaged = true;
// Join the enemy's battle, or create a new one
if (otherCombatant.battle == null) {
battle = new Battle();
} else {
battle = otherCombatant.battle;
}
// Add fighters to the battle
foreach (Fighter f in Fighters) {
battle.AddFighter(f);
}
// We want the battle to notify us when it ends,
// so we can disengage
battle.Ended += OnBattleEnd;
// Notify
JoinedBattle(this, new CombatantEventArgs {
Battle = battle
});
}
}
}
示例7: Start
// Use this for initialization
void Start()
{
//Dictionary<Storage.UnitTypes, uint> dUnits = new Dictionary<Storage.UnitTypes, uint>();
//Dictionary<Storage.BuildingTypes, uint> dBuildings = new Dictionary<Storage.BuildingTypes, uint>();
missionsToComplete = 0;
GameInformation info = GameObject.Find("GameInformationObject").GetComponent<GameInformation>();
battle = info.GetBattle();
foreach (Battle.MissionDefinition mission in battle.GetMissions())
{
switch (mission.purpose)
{
case Battle.MissionType.DESTROY:
switch (mission.target)
{
case Storage.EntityType.UNIT:
destroyedUnitsWinners.Add(mission.targetType.unit, 0);
//dUnits.Add(mission.targetType.unit, mission.amount);
missionsToComplete++;
break;
case Storage.EntityType.BUILDING:
destroyedBuildingsWinners.Add(mission.targetType.building, 0);
//dBuildings.Add(mission.targetType.building, mission.amount);
missionsToComplete++;
break;
}
break;
}
}
}
示例8: Encounter
public override void Encounter()
{
int level = rng.Next(3, 6);
int level2 = rng.Next(4, 7);
int species = rng.Next(1, 101);
Battle battle = new Battle();
if (species > 75)
{
battle.Wild(generator.Create("Caterpie", level));
}
else if (species > 50)
{
battle.Wild(generator.Create("Weedle", level));
}
else if (species > 30)
{
battle.Wild(generator.Create("Pidgey", level));
}
else if (species > 15)
{
battle.Wild(generator.Create("Metapod", level2));
}
else
{
battle.Wild(generator.Create("Kakuna", level2));
}
}
示例9: OnExecuteCommand
public void OnExecuteCommand(Battle.MessageConstants.ExecuteCommandHook hook)
{
var executer = AllPartyManager.Instance.ActiveTimeMaxBattleCharacter;
var selectCommandData = executer.SelectCommandData;
selectCommandData.Impact.Damage = CalcurateDamage.Range( this.data.PowerMinToInt, this.data.PowerMaxToInt );
selectCommandData.Impact.Target.TakeDamage( selectCommandData.Impact.Damage );
}
示例10: CreateUser
public Regulus.Project.Crystal.Game.Core CreateUser(Regulus.Remoting.ISoulBinder binder, IStorage storage, IMap zone , Battle.IZone battle)
{
var core = new Regulus.Project.Crystal.Game.Core(binder, storage, zone, battle);
_Users.AddFramework(core);
core.InactiveEvent += () => { _Users.RemoveFramework(core); };
return core;
}
示例11: MainWindow
public MainWindow(Battle.Core.BattlelordsSession session)
: base("Battle")
{
this.session = session;
this.build();
this.DeleteEvent += HandleHandleDeleteEvent;
}
示例12: Main
static void Main( string[] args )
{
Messenger.Input = Console.ReadLine;
Messenger.Message.Subscribe( MessageWriter );
var hero = new HeroBattler( Messenger, "勇者", 20, 20 );
var witch = new HeroBattler( Messenger, "魔女", 18, 18 );
var enemy = new Battler( Messenger, "スキュラ", 20, 20 );
var enemy2 = new Battler( Messenger, "モノアイ", 16, 16 );
var atackSkill = new Skill( "攻撃", 1, 1, Atack );
var pluralAtackSkill = new Skill( "連続攻撃", 1, 1, PluralAtack );
var starSkill = new Skill( "星を落とす魔法", 1, 3, StarMagic );
var fireSkill = new Skill( "炎の剣", 2, 1, FireSlash );
hero.AddSkill( atackSkill );
hero.AddSkill( pluralAtackSkill );
hero.AddSkill( fireSkill );
witch.AddSkill( atackSkill );
witch.AddSkill( starSkill );
enemy.AddSkill( atackSkill );
enemy.AddSkill( pluralAtackSkill );
enemy2.AddSkill( atackSkill );
var battle = new Battle( Messenger, new[] { hero, witch }, new[] { enemy, enemy2 } );
var sub = battle.Run().ToMicrothread();
while( sub.Current == BattleState.Fighting )
{
sub.Yield();
}
Console.WriteLine( "End" );
Console.ReadLine();
}
示例13: NewCharacterWindow
public NewCharacterWindow(Battle.Core.BattlelordsSession session)
{
this.session = session;
this.SetDefaultSize(400,300);
this.SetPosition(WindowPosition.Center);
this.build();
}
示例14: Click
/*
public void Click(){
battle = GetComponentInParent<Battle>();
Debug.Log("click Atk");
//battle.act1 = Accion.CreateAccion("AttackGeneric");
battle.act1 = Accion.CreateAccion(battle.userMon.GetMov(battle.userMon.lv)[0],battle.opoMon);
}*/
public void Click()
{
battle = GetComponentInParent<Battle>();
battle.user.nroMovimiento = 0;
battle.user.target = battle.opoMon;
battle.user.clicks = accionesEntrenador.Ataque;
}
示例15: Awake
///////////////////////////////////////////////////////////////////////////////
// Function
///////////////////////////////////////////////////////////////////////////////
new void Awake() {
base.Awake();
levelName = GameLevel.Battle.ToString();
instance = this;
input = GetComponent<GameInput>();
input.enabled = false;
}