1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using System.Text; |
---|
5 | using Jypeli; |
---|
6 | |
---|
7 | public static class AttackList |
---|
8 | { |
---|
9 | public static AttackBase Attack() |
---|
10 | { |
---|
11 | AttackBase Attack = new AttackBase(); |
---|
12 | Attack.Name = "attack"; |
---|
13 | Attack.DMG = 5; |
---|
14 | Attack.LearnAtLevel = 1; |
---|
15 | |
---|
16 | Attack.OnUse = delegate { |
---|
17 | BattleView.CurrentBattleView.SelectSingleEnemyForAttackTarget(AttackList.Attack()); |
---|
18 | }; |
---|
19 | |
---|
20 | return Attack; |
---|
21 | } |
---|
22 | |
---|
23 | public static AttackBase SpookyAttack() |
---|
24 | { |
---|
25 | AttackBase SpookyAttack = new AttackBase(); |
---|
26 | SpookyAttack.DMG = 10; |
---|
27 | |
---|
28 | SpookyAttack.OnUse = delegate |
---|
29 | { |
---|
30 | BattleView.CurrentBattleView.Attacker.CanMakeAction = false; |
---|
31 | EnemyBase user = BattleView.CurrentBattleView.Attacker; |
---|
32 | |
---|
33 | CharacterBase character = BattleView.CurrentBattleView.SelectRandomAlly(); |
---|
34 | |
---|
35 | double BaseDamage = SpookyAttack.BaseDamage(user.Stats.Str, 2); |
---|
36 | int TrueDamage = BattleAlgorithms.DamageFromBasicAttack(BaseDamage, character.CurrentStats.Def); |
---|
37 | character.CurrentHP.Value -= TrueDamage; |
---|
38 | |
---|
39 | if(SoundEffects.Battle.Hit_01.IsPlaying) |
---|
40 | { |
---|
41 | SoundEffects.Battle.Hit_01.Stop(); |
---|
42 | } |
---|
43 | SoundEffects.Battle.Hit_01.Play(); |
---|
44 | |
---|
45 | BattleView.CurrentBattleView.IsAttackAnimationPlaying = false; |
---|
46 | BattleView.CurrentBattleView.IsTimerActive = true; |
---|
47 | }; |
---|
48 | |
---|
49 | return SpookyAttack; |
---|
50 | } |
---|
51 | } |
---|
52 | |
---|
53 | public class AttackBase |
---|
54 | { |
---|
55 | public string Name { get; set; } |
---|
56 | public int LearnAtLevel { get; set; } |
---|
57 | |
---|
58 | public int DMG { get; set; } |
---|
59 | public double BaseDamage(int Str, int Lvl) |
---|
60 | { |
---|
61 | return DMG * Lvl + Str; |
---|
62 | } |
---|
63 | |
---|
64 | public int HitPercent = 100; |
---|
65 | |
---|
66 | public Action OnUse { get; set; } |
---|
67 | public Action Animation { get; set; } |
---|
68 | } |
---|