public AttacksEditorDialog(Monster m) : base(UserInterfaceIdiomIsPhone ? "AttacksEditorDialog_iPhone" : "AttacksEditorDialog_iPad", null) { _Monster = m; _Attacks = new CharacterAttacks(new ObservableCollection <AttackSet>(_Monster.MeleeAttacks), new ObservableCollection <Attack>(_Monster.RangedAttacks)); }
protected override void OnCreate(Bundle bundle) { CoreContext.Context = Application.Context; base.OnCreate(bundle); SetContentView(Resource.Layout.AttacksEditor); if (_Attacks == null) { var sets = new ObservableCollection <AttackSet>(_Monster.MeleeAttacks); var ranged = new ObservableCollection <Attack>(_Monster.RangedAttacks); _Attacks = new CharacterAttacks(sets, ranged); } BuildMeleeTabs(); BuildMeleeGroup(); BuildRanged(); BuildNatural(); Button b = FindViewById <Button>(Resource.Id.okButton); b.Click += (object sender, EventArgs e) => { _Monster.Melee = _Monster.MeleeString(_Attacks); _Monster.Ranged = _Monster.RangedString(_Attacks); _Attacks = null; Finish(); }; b = FindViewById <Button>(Resource.Id.cancelButton); b.Click += (object sender, EventArgs e) => { _Attacks = null; Finish(); }; b = FindViewById <Button>(Resource.Id.addMeleeButton); b.Click += (object sender, EventArgs e) => { AddAttack(true, false, false); }; b = FindViewById <Button>(Resource.Id.addRangedButton); b.Click += (object sender, EventArgs e) => { AddAttack(false, true, false); }; b = FindViewById <Button>(Resource.Id.addNaturalButton); b.Click += (object sender, EventArgs e) => { AddAttack(false, false, true); }; }
private void Start() { spells = GetComponent <CharacterAttacks>(); if (enemyType.ToString() == "flying") { moving = true; } target = Player.instance.transform; combat = GetComponent <CharacterCombat>(); characterStats = GetComponent <CharacterStats>(); startPos = transform.position; }
public override void OnBackPressed() { _Attacks = null; base.OnBackPressed(); }
public override void ViewDidLoad() { base.ViewDidLoad(); foreach (GradientView v in new GradientView[] { SpeedView, AttacksView, AbilitiesView }) { StylePanel(v); } CurrentMonster.Adjuster.PropertyChanged += MonsterAdjusterPropertyChanged; ButtonPropertyManager m; m = new ButtonPropertyManager(SpeedButton, DialogParent, CurrentMonster.Adjuster, "LandSpeed") { Title = "Land Speed", MinIntValue = 0 }; _Managers.Add(m); m = new ButtonPropertyManager(ClimbButton, DialogParent, CurrentMonster.Adjuster, "ClimbSpeed") { Title = "Climb Speed", MinIntValue = 0 }; _Managers.Add(m); m = new ButtonPropertyManager(SpaceButton, DialogParent, CurrentMonster.Adjuster, "Space") { Title = "Space" }; _Managers.Add(m); m = new ButtonPropertyManager(FlyButton, DialogParent, CurrentMonster.Adjuster, "FlySpeed") { Title = "Fly Speed", MinIntValue = 0 }; _Managers.Add(m); m = new ButtonPropertyManager(BurrowButton, DialogParent, CurrentMonster.Adjuster, "BurrowSpeed") { Title = "Burrow Speed", MinIntValue = 0 }; _Managers.Add(m); m = new ButtonPropertyManager(ReachButton, DialogParent, CurrentMonster.Adjuster, "Reach") { Title = "Reach" }; _Managers.Add(m); m = new ButtonPropertyManager(FlyQualityButton, DialogParent, CurrentMonster.Adjuster, "FlyQuality") { Title = "Fly Quality" }; var list = new List <KeyValuePair <object, string> >(); for (int i = 0; i < 5; i++) { list.Add(new KeyValuePair <object, string>(i, Monster.GetFlyQualityString(i).Capitalize())); } m.ValueList = list; m.FormatDelegate = a => { if (CurrentMonster.Adjuster.FlySpeed == null) { return("-"); } else { return(Monster.GetFlyQualityString((int)a).Capitalize()); } }; _Managers.Add(m); m = new ButtonPropertyManager(SwimButton, DialogParent, CurrentMonster.Adjuster, "SwimSpeed") { Title = "Swim Speed" }; _Managers.Add(m); m = new ButtonPropertyManager(SpecialAttacksButton, DialogParent, CurrentMonster, "SpecialAttacks") { Title = "Special Attacks", Multiline = true }; _Managers.Add(m); m = new ButtonPropertyManager(SpellLikeAbilitiesButton, DialogParent, CurrentMonster.Adjuster, "SpellLikeAbilities") { Title = "Spell-Like Abilities", Multiline = true }; _Managers.Add(m); m = new ButtonPropertyManager(SpellsKnownButton, DialogParent, CurrentMonster.Adjuster, "SpellsKnown") { Title = "Spells Known", Multiline = true }; _Managers.Add(m); m = new ButtonPropertyManager(SpellsPreparedButton, DialogParent, CurrentMonster.Adjuster, "SpellsPrepared") { Title = "SpellsPrepared", Multiline = true }; _Managers.Add(m); m = new ButtonPropertyManager(MeleeButton, DialogParent, CurrentMonster, "Melee") { Title = "Melee", Multiline = true }; _Managers.Add(m); m = new ButtonPropertyManager(RangedButton, DialogParent, CurrentMonster, "Ranged") { Title = "Ranged", Multiline = true }; _Managers.Add(m); foreach (GradientButton b in from x in _Managers select x.Button) { CMStyles.TextFieldStyle(b, 15f); } AttacksEditorButton.TouchUpInside += (sender, e) => { _AEDialog = new AttacksEditorDialog(CurrentMonster); _AEDialog.OKClicked += (senderx, e1) => { CharacterAttacks at = _AEDialog.Attacks; CurrentMonster.Melee = CurrentMonster.MeleeString(at); CurrentMonster.Ranged = CurrentMonster.RangedString(at); }; DialogParent.Add(_AEDialog.View); }; UpdateButtonState(); }