import java.awt.*; import java.lang.*; import java.util.*; import Location; import Player; public final class Player_Tietal extends Player { private final double rotate = 0.1963; private final int maxVelocity = 6; private final int accel = 1; private final int maxShields = 140; private final int firePowerStep = 16; private final int maxFirePower = 38; private final Color myColor[] = { new Color(192, 192, 192), new Color(96, 96, 96), new Color(255, 64, 0), new Color(255, 32, 255) }; private int mx[] = new int[10]; private int my[] = new int[10]; Player_Tietal(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 - Math.round((float) (2*Math.cos(angle)))-1, y - Math.round((float) (2*Math.sin(angle)))-1, 3, 3); mx[0] = x - Math.round((float) (2*Math.cos(angle)));; mx[1] = x - Math.round((float) (6*Math.cos(angle))) - Math.round((float) (3*Math.sin(angle))); mx[2] = x - Math.round((float) (8*Math.cos(angle))) - Math.round((float) (8*Math.sin(angle))); mx[3] = x + Math.round((float) (5*Math.cos(angle))) - Math.round((float) (5*Math.sin(angle))); mx[4] = x + Math.round((float) (4*Math.cos(angle))) - Math.round((float) (3*Math.sin(angle))); mx[5] = x + Math.round((float) (8*Math.cos(angle))); mx[6] = x + Math.round((float) (4*Math.cos(angle))) + Math.round((float) (3*Math.sin(angle))); mx[7] = x + Math.round((float) (5*Math.cos(angle))) + Math.round((float) (5*Math.sin(angle))); mx[8] = x - Math.round((float) (8*Math.cos(angle))) + Math.round((float) (8*Math.sin(angle))); mx[9] = x - Math.round((float) (6*Math.cos(angle))) + Math.round((float) (3*Math.sin(angle))); my[0] = y; my[1] = y - Math.round((float) (6*Math.sin(angle))) + Math.round((float) (3*Math.cos(angle))); my[2] = y - Math.round((float) (8*Math.sin(angle))) + Math.round((float) (8*Math.cos(angle))); my[3] = y + Math.round((float) (5*Math.sin(angle))) + Math.round((float) (5*Math.cos(angle))); my[4] = y + Math.round((float) (4*Math.sin(angle))) + Math.round((float) (3*Math.cos(angle))); my[5] = y + Math.round((float) (8*Math.sin(angle))); my[6] = y + Math.round((float) (4*Math.sin(angle))) - Math.round((float) (3*Math.cos(angle))); my[7] = y + Math.round((float) (5*Math.sin(angle))) - Math.round((float) (5*Math.cos(angle))); my[8] = y - Math.round((float) (8*Math.sin(angle))) - Math.round((float) (8*Math.cos(angle))); my[9] = y - Math.round((float) (6*Math.sin(angle))) - Math.round((float) (3*Math.cos(angle))); g.setColor(myColor[0]); g.fillPolygon(mx,my,10); g.setColor(myColor[3]); g.drawLine(x,y, x + Math.round((float) (10*Math.cos(angle))), y + Math.round((float) (10*Math.sin(angle)))); g.setColor(myColor[1]); g.fillOval(x + Math.round((float) (3*Math.cos(angle)))-1, y + Math.round((float) (3*Math.sin(angle)))-1, 3, 3); } public final String getDescription() { return "This medium fighter is average in everything."; } public final int[] getData() { int temp[] = { 32, maxVelocity, accel, maxShields, firePowerStep, maxFirePower }; return temp; } }