import java.awt.*; import java.lang.*; import java.util.*; import Location; import Player; public final class Player_Hycha extends Player { private final double rotate = 0.1571; private final int maxVelocity = 5; private final int accel = 1; private final int maxShields = 160; private final int firePowerStep = 18; private final int maxFirePower = 44; private final Color myColor[] = { new Color(32, 128, 32), new Color(0, 192, 0), new Color(255, 64, 0), new Color(255, 32, 255) }; private int mx[] = new int[17]; private int my[] = new int[17]; Player_Hycha(int id, String name) { this.name = name; this.id = id; shields = maxShields; firePower = firePowerStep; alive = true; setConstants(rotate, maxVelocity, accel, maxShields, firePowerStep, maxFirePower); } public final void paint(Graphics g, int x, int y, int t) { for (int i = t; i > 0; i--) { pastX[i] = pastX[i-1]; pastY[i] = pastY[i-1]; if (pastX[i] != -1) { g.setColor(engine[i]); g.fillOval(pastX[i]+(x-1)-X, pastY[i]+(y-1)-Y, 3, 3); } } g.setColor(Color.pink); for (int i = 0; i < 5 && t == 14; i++) { if (fire[i] != -1) g.fillOval(fireX[i]+(x-1)-X, fireY[i]+(y-1)-Y, 3, 3); } g.setColor(myColor[2]); g.fillOval(x - 2, y - 2, 5, 5); mx[0] = x; mx[1] = x - Math.round((float) (8*Math.cos(angle))) - Math.round((float) (3*Math.sin(angle))); mx[2] = x - Math.round((float) (4*Math.cos(angle))) - Math.round((float) (10*Math.sin(angle))); mx[3] = x + Math.round((float) (4*Math.cos(angle))) - Math.round((float) (7*Math.sin(angle))); mx[4] = x + Math.round((float) (1*Math.cos(angle))) - Math.round((float) (4*Math.sin(angle))); mx[5] = x + Math.round((float) (3*Math.cos(angle))) - Math.round((float) (3*Math.sin(angle))); mx[6] = x + Math.round((float) (7*Math.cos(angle))) - Math.round((float) (1*Math.sin(angle))); mx[7] = x + Math.round((float) (8*Math.cos(angle))) - Math.round((float) (3*Math.sin(angle))); mx[8] = x + Math.round((float) (10*Math.cos(angle))) - Math.round((float) (2*Math.sin(angle))); mx[9] = x + Math.round((float) (10*Math.cos(angle))) + Math.round((float) (2*Math.sin(angle))); mx[10] = x + Math.round((float) (8*Math.cos(angle))) + Math.round((float) (3*Math.sin(angle))); mx[11] = x + Math.round((float) (7*Math.cos(angle))) + Math.round((float) (1*Math.sin(angle))); mx[12] = x + Math.round((float) (3*Math.cos(angle))) + Math.round((float) (3*Math.sin(angle))); mx[13] = x + Math.round((float) (1*Math.cos(angle))) + Math.round((float) (4*Math.sin(angle))); mx[14] = x + Math.round((float) (4*Math.cos(angle))) + Math.round((float) (7*Math.sin(angle))); mx[15] = x - Math.round((float) (4*Math.cos(angle))) + Math.round((float) (10*Math.sin(angle))); mx[16] = x - Math.round((float) (8*Math.cos(angle))) + Math.round((float) (3*Math.sin(angle))); my[0] = y; my[1] = y - Math.round((float) (8*Math.sin(angle))) + Math.round((float) (3*Math.cos(angle))); my[2] = y - Math.round((float) (4*Math.sin(angle))) + Math.round((float) (10*Math.cos(angle))); my[3] = y + Math.round((float) (4*Math.sin(angle))) + Math.round((float) (7*Math.cos(angle))); my[4] = y + Math.round((float) (1*Math.sin(angle))) + Math.round((float) (4*Math.cos(angle))); my[5] = y + Math.round((float) (3*Math.sin(angle))) + Math.round((float) (3*Math.cos(angle))); my[6] = y + Math.round((float) (7*Math.sin(angle))) + Math.round((float) (1*Math.cos(angle))); my[7] = y + Math.round((float) (8*Math.sin(angle))) + Math.round((float) (3*Math.cos(angle))); my[8] = y + Math.round((float) (10*Math.sin(angle))) + Math.round((float) (2*Math.cos(angle))); my[9] = y + Math.round((float) (10*Math.sin(angle))) - Math.round((float) (2*Math.cos(angle))); my[10] = y + Math.round((float) (8*Math.sin(angle))) - Math.round((float) (3*Math.cos(angle))); my[11] = y + Math.round((float) (7*Math.sin(angle))) - Math.round((float) (1*Math.cos(angle))); my[12] = y + Math.round((float) (3*Math.sin(angle))) - Math.round((float) (3*Math.cos(angle))); my[13] = y + Math.round((float) (1*Math.sin(angle))) - Math.round((float) (4*Math.cos(angle))); my[14] = y + Math.round((float) (4*Math.sin(angle))) - Math.round((float) (7*Math.cos(angle))); my[15] = y - Math.round((float) (4*Math.sin(angle))) - Math.round((float) (10*Math.cos(angle))); my[16] = y - Math.round((float) (8*Math.sin(angle))) - Math.round((float) (3*Math.cos(angle))); g.setColor(myColor[0]); g.fillPolygon(mx,my,17); g.setColor(myColor[1]); g.drawLine(x,y, x + Math.round((float) (10*Math.cos(angle))), y + Math.round((float) (10*Math.sin(angle)))); g.setColor(myColor[3]); g.fillOval(x + Math.round((float) (10*Math.cos(angle)))-1, y + Math.round((float) (10*Math.sin(angle)))-1, 3, 3); } public final String getDescription() { return "This heavy fighter is slow, but has great fire power."; } public final int[] getData() { int temp[] = { 40, maxVelocity, accel, maxShields, firePowerStep, maxFirePower }; return temp; } }