|
14 | 14 | * @author Be4rJP |
15 | 15 | */ |
16 | 16 | public class Animation { |
17 | | - public static void ResultAnimation(Player p, int team0point, int team1point, String team0color, String team1color, Team winteam, Boolean hikiwake){ |
18 | | - BukkitRunnable task = new BukkitRunnable(){ |
19 | | - Player player = p; |
20 | | - int i = 0; |
21 | | - int g = 0; |
22 | | - @Override |
23 | | - public void run(){ |
24 | | - |
25 | | - if(i <= 15){ |
26 | | - player.sendTitle("", String.valueOf(g) + "% [" + GaugeAPI.toGauge(g,50,team0color,"§7") + GaugeAPI.toGauge(50 - g,50,"§7",team1color) + "] " + String.valueOf(g) + "%", 0, 40, 0); |
27 | | - g = g + 2; |
28 | | - } |
29 | | - /* |
30 | | - if(i >= 6 && i <= 10){ |
31 | | - player.sendTitle("", String.valueOf(g) + "% [" + GaugeAPI.toGauge(g,50,team0color,"§7") + GaugeAPI.toGauge(50 - g,50,"§7",team1color) + "] " + String.valueOf(g) + "%", 0, 40, 0); |
32 | | - g++; |
33 | | - }*/ |
34 | | - if(i == 35){ |
35 | | - if(hikiwake){ |
36 | | - player.sendTitle("引き分け!", "[" + GaugeAPI.toGauge(50,100, team0color, team1color) + "]", 0, 40, 10); |
37 | | - }else{ |
38 | | - if(winteam == DataMgr.getPlayerData(player).getTeam()) |
39 | | - player.sendTitle(ChatColor.GREEN + "You Win!", String.valueOf(team0point) + "% [" + GaugeAPI.toGauge(team0point,100, team0color, team1color) + "] " + String.valueOf(100 - team0point) + "%", 0, 40, 10); |
40 | | - else |
41 | | - player.sendTitle(ChatColor.RED + "You Lose...", String.valueOf(team0point) + "% [" + GaugeAPI.toGauge(team0point,100, team0color, team1color) + "] " + String.valueOf(100 - team0point) + "%", 0, 40, 10); |
42 | | - } |
43 | | - player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_INFECT, 13.0F, 1.5F); |
44 | | - } |
45 | | - if(i == 40){ |
46 | | - if(winteam == DataMgr.getPlayerData(player).getTeam()) |
47 | | - Sclat.playGameSound(player, SoundType.CONGRATULATIONS); |
48 | | - cancel(); |
49 | | - } |
50 | | - i++; |
51 | | - } |
52 | | - }; |
53 | | - task.runTaskTimer(Main.getPlugin(), 0, 2); |
54 | | - } |
55 | | - |
56 | | - public static void AreaResultAnimation(Player p, int team0point, int team1point, String team0color, String team1color, Team winteam){ |
57 | | - BukkitRunnable task = new BukkitRunnable(){ |
58 | | - Player player = p; |
59 | | - int i = 0; |
60 | | - int g = 0; |
61 | | - @Override |
62 | | - public void run(){ |
63 | | - |
64 | | - if(i <= 15){ |
65 | | - player.sendTitle("", String.valueOf(g) + "% [" + GaugeAPI.toGauge(g,50,team0color,"§7") + GaugeAPI.toGauge(50 - g,50,"§7",team1color) + "] " + String.valueOf(g) + "%", 0, 40, 0); |
66 | | - g = g + 2; |
67 | | - } |
68 | | - if(i == 35){ |
69 | | - if(winteam == DataMgr.getPlayerData(player).getTeam()) |
70 | | - player.sendTitle(ChatColor.GREEN + "Knock Out !!", String.valueOf(team0point) + "% [" + GaugeAPI.toGauge(team0point,100, team0color, team1color) + "] " + String.valueOf(100 - team0point) + "%", 0, 40, 10); |
71 | | - else |
72 | | - player.sendTitle(ChatColor.RED + "You Lose...", String.valueOf(team0point) + "% [" + GaugeAPI.toGauge(team0point,100, team0color, team1color) + "] " + String.valueOf(100 - team0point) + "%", 0, 40, 10); |
73 | | - player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_INFECT, 13.0F, 1.5F); |
74 | | - } |
75 | | - if(i == 40){ |
76 | | - if(winteam == DataMgr.getPlayerData(player).getTeam()) |
77 | | - Sclat.playGameSound(player, SoundType.CONGRATULATIONS); |
78 | | - cancel(); |
79 | | - } |
80 | | - i++; |
81 | | - } |
82 | | - }; |
83 | | - task.runTaskTimer(Main.getPlugin(), 0, 2); |
84 | | - } |
85 | | - |
86 | | - |
87 | | - public static void TDMResultAnimation(Player p, int team0point, int team1point, String team0color, String team1color, Team winteam, Boolean hikiwake){ |
88 | | - BukkitRunnable task = new BukkitRunnable(){ |
89 | | - Player player = p; |
90 | | - int i = 0; |
91 | | - @Override |
92 | | - public void run(){ |
93 | | - |
94 | | - if(i <= 15){ |
95 | | - player.sendTitle("", team0color + DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(new Random().nextInt(10)) + " Kill " + team1color + DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(new Random().nextInt(10)) + " Kill", 0, 40, 0); |
96 | | - } |
97 | | - /* |
98 | | - if(i >= 6 && i <= 10){ |
99 | | - player.sendTitle("", String.valueOf(g) + "% [" + GaugeAPI.toGauge(g,50,team0color,"§7") + GaugeAPI.toGauge(50 - g,50,"§7",team1color) + "] " + String.valueOf(g) + "%", 0, 40, 0); |
100 | | - g++; |
101 | | - }*/ |
102 | | - if(i == 35){ |
103 | | - if(hikiwake){ |
104 | | - player.sendTitle("引き分け!", team0color + DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(team0point) + " Kill " + team1color + DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(team1point) + " Kill", 0, 40, 10); |
105 | | - }else{ |
106 | | - if(winteam == DataMgr.getPlayerData(player).getTeam()) |
107 | | - player.sendTitle(ChatColor.GREEN + "You Win!", team0color + DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(team0point) + " Kill " + team1color + DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(team1point) + " Kill", 0, 40, 10); |
108 | | - else |
109 | | - player.sendTitle(ChatColor.RED + "You Lose...", team0color + DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(team0point) + " Kill " + team1color + DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(team1point) + " Kill", 0, 40, 10); |
110 | | - } |
111 | | - player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_INFECT, 13.0F, 1.5F); |
112 | | - } |
113 | | - if(i == 40){ |
114 | | - if(winteam == DataMgr.getPlayerData(player).getTeam()) |
115 | | - Sclat.playGameSound(player, SoundType.CONGRATULATIONS); |
116 | | - cancel(); |
117 | | - } |
118 | | - i++; |
119 | | - } |
120 | | - }; |
121 | | - task.runTaskTimer(Main.getPlugin(), 0, 2); |
122 | | - } |
| 17 | + public static void ResultAnimation(Player p, int team0point, int team1point, String team0color, String team1color, |
| 18 | + Team winteam, Boolean hikiwake) { |
| 19 | + BukkitRunnable task = new BukkitRunnable() { |
| 20 | + Player player = p; |
| 21 | + int i = 0; |
| 22 | + int g = 0; |
| 23 | + @Override |
| 24 | + public void run() { |
| 25 | + |
| 26 | + if (i <= 15) { |
| 27 | + player.sendTitle("", |
| 28 | + String.valueOf(g) + "% [" + GaugeAPI.toGauge(g, 50, team0color, "§7") |
| 29 | + + GaugeAPI.toGauge(50 - g, 50, "§7", team1color) + "] " + String.valueOf(g) + "%", |
| 30 | + 0, 40, 0); |
| 31 | + g = g + 2; |
| 32 | + } |
| 33 | + /* |
| 34 | + * if(i >= 6 && i <= 10){ player.sendTitle("", String.valueOf(g) + "% [" + |
| 35 | + * GaugeAPI.toGauge(g,50,team0color,"§7") + GaugeAPI.toGauge(50 - |
| 36 | + * g,50,"§7",team1color) + "] " + String.valueOf(g) + "%", 0, 40, 0); g++; } |
| 37 | + */ |
| 38 | + if (i == 35) { |
| 39 | + if (hikiwake) { |
| 40 | + player.sendTitle("引き分け!", "[" + GaugeAPI.toGauge(50, 100, team0color, team1color) + "]", 0, 40, |
| 41 | + 10); |
| 42 | + } else { |
| 43 | + if (winteam == DataMgr.getPlayerData(player).getTeam()) |
| 44 | + player.sendTitle(ChatColor.GREEN + "You Win!", |
| 45 | + String.valueOf(team0point) + "% [" |
| 46 | + + GaugeAPI.toGauge(team0point, 100, team0color, team1color) + "] " |
| 47 | + + String.valueOf(100 - team0point) + "%", |
| 48 | + 0, 40, 10); |
| 49 | + else |
| 50 | + player.sendTitle(ChatColor.RED + "You Lose...", |
| 51 | + String.valueOf(team0point) + "% [" |
| 52 | + + GaugeAPI.toGauge(team0point, 100, team0color, team1color) + "] " |
| 53 | + + String.valueOf(100 - team0point) + "%", |
| 54 | + 0, 40, 10); |
| 55 | + } |
| 56 | + player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_INFECT, 13.0F, 1.5F); |
| 57 | + } |
| 58 | + if (i == 40) { |
| 59 | + if (winteam == DataMgr.getPlayerData(player).getTeam()) |
| 60 | + Sclat.playGameSound(player, SoundType.CONGRATULATIONS); |
| 61 | + cancel(); |
| 62 | + } |
| 63 | + i++; |
| 64 | + } |
| 65 | + }; |
| 66 | + task.runTaskTimer(Main.getPlugin(), 0, 2); |
| 67 | + } |
| 68 | + |
| 69 | + public static void AreaResultAnimation(Player p, int team0point, int team1point, String team0color, |
| 70 | + String team1color, Team winteam) { |
| 71 | + BukkitRunnable task = new BukkitRunnable() { |
| 72 | + Player player = p; |
| 73 | + int i = 0; |
| 74 | + int g = 0; |
| 75 | + @Override |
| 76 | + public void run() { |
| 77 | + |
| 78 | + if (i <= 15) { |
| 79 | + player.sendTitle("", |
| 80 | + String.valueOf(g) + "% [" + GaugeAPI.toGauge(g, 50, team0color, "§7") |
| 81 | + + GaugeAPI.toGauge(50 - g, 50, "§7", team1color) + "] " + String.valueOf(g) + "%", |
| 82 | + 0, 40, 0); |
| 83 | + g = g + 2; |
| 84 | + } |
| 85 | + if (i == 35) { |
| 86 | + if (winteam == DataMgr.getPlayerData(player).getTeam()) |
| 87 | + player.sendTitle(ChatColor.GREEN + "Knock Out !!", |
| 88 | + String.valueOf(team0point) + "% [" |
| 89 | + + GaugeAPI.toGauge(team0point, 100, team0color, team1color) + "] " |
| 90 | + + String.valueOf(100 - team0point) + "%", |
| 91 | + 0, 40, 10); |
| 92 | + else |
| 93 | + player.sendTitle(ChatColor.RED + "You Lose...", |
| 94 | + String.valueOf(team0point) + "% [" |
| 95 | + + GaugeAPI.toGauge(team0point, 100, team0color, team1color) + "] " |
| 96 | + + String.valueOf(100 - team0point) + "%", |
| 97 | + 0, 40, 10); |
| 98 | + player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_INFECT, 13.0F, 1.5F); |
| 99 | + } |
| 100 | + if (i == 40) { |
| 101 | + if (winteam == DataMgr.getPlayerData(player).getTeam()) |
| 102 | + Sclat.playGameSound(player, SoundType.CONGRATULATIONS); |
| 103 | + cancel(); |
| 104 | + } |
| 105 | + i++; |
| 106 | + } |
| 107 | + }; |
| 108 | + task.runTaskTimer(Main.getPlugin(), 0, 2); |
| 109 | + } |
| 110 | + |
| 111 | + public static void TDMResultAnimation(Player p, int team0point, int team1point, String team0color, |
| 112 | + String team1color, Team winteam, Boolean hikiwake) { |
| 113 | + BukkitRunnable task = new BukkitRunnable() { |
| 114 | + Player player = p; |
| 115 | + int i = 0; |
| 116 | + @Override |
| 117 | + public void run() { |
| 118 | + |
| 119 | + if (i <= 15) { |
| 120 | + player.sendTitle("", team0color |
| 121 | + + DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor().getColorName() + "Team" |
| 122 | + + ChatColor.RESET + " : " + String.valueOf(new Random().nextInt(10)) + " Kill " |
| 123 | + + team1color |
| 124 | + + DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor().getColorName() + "Team" |
| 125 | + + ChatColor.RESET + " : " + String.valueOf(new Random().nextInt(10)) + " Kill", 0, 40, 0); |
| 126 | + } |
| 127 | + /* |
| 128 | + * if(i >= 6 && i <= 10){ player.sendTitle("", String.valueOf(g) + "% [" + |
| 129 | + * GaugeAPI.toGauge(g,50,team0color,"§7") + GaugeAPI.toGauge(50 - |
| 130 | + * g,50,"§7",team1color) + "] " + String.valueOf(g) + "%", 0, 40, 0); g++; } |
| 131 | + */ |
| 132 | + if (i == 35) { |
| 133 | + if (hikiwake) { |
| 134 | + player.sendTitle("引き分け!", |
| 135 | + team0color |
| 136 | + + DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor() |
| 137 | + .getColorName() |
| 138 | + + "Team" + ChatColor.RESET + " : " + String.valueOf(team0point) + " Kill " |
| 139 | + + team1color |
| 140 | + + DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor() |
| 141 | + .getColorName() |
| 142 | + + "Team" + ChatColor.RESET + " : " + String.valueOf(team1point) + " Kill", |
| 143 | + 0, 40, 10); |
| 144 | + } else { |
| 145 | + if (winteam == DataMgr.getPlayerData(player).getTeam()) |
| 146 | + player.sendTitle(ChatColor.GREEN + "You Win!", |
| 147 | + team0color |
| 148 | + + DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor() |
| 149 | + .getColorName() |
| 150 | + + "Team" + ChatColor.RESET + " : " + String.valueOf(team0point) |
| 151 | + + " Kill " + team1color |
| 152 | + + DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor() |
| 153 | + .getColorName() |
| 154 | + + "Team" + ChatColor.RESET + " : " + String.valueOf(team1point) + " Kill", |
| 155 | + 0, 40, 10); |
| 156 | + else |
| 157 | + player.sendTitle(ChatColor.RED + "You Lose...", |
| 158 | + team0color |
| 159 | + + DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor() |
| 160 | + .getColorName() |
| 161 | + + "Team" + ChatColor.RESET + " : " + String.valueOf(team0point) |
| 162 | + + " Kill " + team1color |
| 163 | + + DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor() |
| 164 | + .getColorName() |
| 165 | + + "Team" + ChatColor.RESET + " : " + String.valueOf(team1point) + " Kill", |
| 166 | + 0, 40, 10); |
| 167 | + } |
| 168 | + player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_INFECT, 13.0F, 1.5F); |
| 169 | + } |
| 170 | + if (i == 40) { |
| 171 | + if (winteam == DataMgr.getPlayerData(player).getTeam()) |
| 172 | + Sclat.playGameSound(player, SoundType.CONGRATULATIONS); |
| 173 | + cancel(); |
| 174 | + } |
| 175 | + i++; |
| 176 | + } |
| 177 | + }; |
| 178 | + task.runTaskTimer(Main.getPlugin(), 0, 2); |
| 179 | + } |
123 | 180 | } |
0 commit comments