亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? stunner.java

?? 用java開發(fā)的一個(gè)實(shí)施策略游戲源碼 值得學(xué)習(xí)一下
?? JAVA
字號(hào):
/*
	Netwar
	Copyright (C) 2002  Daniel Grund, Kyle Kakligian, Jason Komutrattananon, & Brian Hibler.

	This file is part of Netwar.

	Netwar is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	Netwar is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with Netwar; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package netwar.game.unit;
import netwar.game.*;
import netwar.utils.*;
import netwar.utils.vectorgraphics.*;
import netwar.game.projectile.Paralyzer;
import java.awt.*;

/** Experimental paralyzer unit.
 * @author Group N2 - Project Netwar
 * @author Daniel Grund
 */
public class Stunner extends Unit {
	ZOrderedList zol;
	CoherentPointSet cps;
	CoherentPointSet orb;
	private static Color orbColor = new Color(96, 96, 255, 50);
	/** Constuctor. This Unit has no special parameters. */
	public Stunner(){
	}
	protected int framesToMove(){
		return 10; //return the number of frames needed to move one hex.
	}
	protected int framesToRotate(){
		return 6; //return the number of frames needed to rotate one hex-side.
	}
	protected int framesToMake(){
		return 50;
	}
	protected int framesToDie(){
		return 10;
	}
	protected void createVectors()
	{
		int i = f * 60 + 30;
		vr = new Point3D[1];

		vr[0] = Hex.getMapPoint(x,y);

		zol = new ZOrderedList(netwar.gui.HexViewer.getHexViewer().getTransform());
		cps = new CoherentPointSet(36);
		orb = new CoherentPointSet(6);
		Color darker = myPlayer.getColor().darker();
		
		//SIGMA
		cps.add(new SelfConvertingPoint(3.75f,1,0.25f));//0
		cps.add(new SelfConvertingPoint(3.75f,-1,0.25f));//1
		cps.add(new SelfConvertingPoint(3.5f,0,0.5f));//2
		cps.add(new SelfConvertingPoint(3.25f,-1,0.75f));//3
		cps.add(new SelfConvertingPoint(3.25f,1,0.75f));//4

		//Outer edges
		cps.add(new SelfConvertingPoint(4, -3, 0)); //5
		cps.add(new SelfConvertingPoint(3, 4, 0)); //6
		cps.add(new SelfConvertingPoint(-4, 3, 0)); //7
		cps.add(new SelfConvertingPoint(-3, -4, 0)); //8

		cps.add(new SelfConvertingPoint(3, -4, 0)); //9
		cps.add(new SelfConvertingPoint(4, 3, 0)); //10
		cps.add(new SelfConvertingPoint(-3, 4, 0)); //11
		cps.add(new SelfConvertingPoint(-4, -3, 0)); //12

		//Bottom corners
		cps.add(new SelfConvertingPoint(3, -3, 0)); //13
		cps.add(new SelfConvertingPoint(3, 3, 0)); //14
		cps.add(new SelfConvertingPoint(-3, 3, 0)); //15
		cps.add(new SelfConvertingPoint(-3, -3, 0)); //16

		//Upper corners
		cps.add(new SelfConvertingPoint(3, -3, 1)); //17
		cps.add(new SelfConvertingPoint(3, 3, 1)); //18
		cps.add(new SelfConvertingPoint(-3, 3, 1)); //19
		cps.add(new SelfConvertingPoint(-3, -3, 1)); //20
		
		//Support bottoms
		cps.add(new SelfConvertingPoint(3, -2, 1)); //21
		cps.add(new SelfConvertingPoint(2, 3, 1)); //22
		cps.add(new SelfConvertingPoint(-3, 2, 1)); //23
		cps.add(new SelfConvertingPoint(-2, -3, 1)); //24
		
		cps.add(new SelfConvertingPoint(2, -3, 1)); //25
		cps.add(new SelfConvertingPoint(3, 2, 1)); //26
		cps.add(new SelfConvertingPoint(-2, 3, 1)); //27
		cps.add(new SelfConvertingPoint(-3, -2, 1)); //28
		
		//Orb (Animate make adjusts these)
		orb.add(new SelfConvertingPoint(0, 0, 1)); //0: bottom
		cps.add(orb.getPoint(0)); //29
		orb.add(new SelfConvertingPoint(0, 0, 1)); //1
		cps.add(orb.getPoint(1)); //30
		orb.add(new SelfConvertingPoint(0, 0, 1)); //2
		cps.add(orb.getPoint(2)); //31
		orb.add(new SelfConvertingPoint(0, 0, 1)); //3
		cps.add(orb.getPoint(3)); //32
		orb.add(new SelfConvertingPoint(0, 0, 1)); //4
		cps.add(orb.getPoint(4)); //33
		orb.add(new SelfConvertingPoint(0, 0, 1)); //5: top
		cps.add(orb.getPoint(5)); //34
		cps.add(new SelfConvertingPoint(0, 0, 1)); //35
		
		//SIGMA panel
		OrderedGraphicSet ogs = new OrderedGraphicSet(
			new GraphicParallelogram(cps.getPoint(5), cps.getPoint(10), cps.getPoint(18), cps.getPoint(17), myPlayer.getColor()), 5);
		ogs.add(new GraphicLine(cps.getPoint(0), cps.getPoint(1), darker), false);
		ogs.add(new GraphicLine(cps.getPoint(1), cps.getPoint(2), darker), false);
		ogs.add(new GraphicLine(cps.getPoint(2), cps.getPoint(3), darker), false);
		ogs.add(new GraphicLine(cps.getPoint(3), cps.getPoint(4), darker), false);
		
		//Panels
		zol.add(ogs);
		zol.add(new GraphicParallelogram(cps.getPoint(6), cps.getPoint(11), cps.getPoint(19), cps.getPoint(18), myPlayer.getColor()));
		zol.add(new GraphicParallelogram(cps.getPoint(7), cps.getPoint(12), cps.getPoint(20), cps.getPoint(19), myPlayer.getColor()));
		zol.add(new GraphicParallelogram(cps.getPoint(8), cps.getPoint(9), cps.getPoint(17), cps.getPoint(20), myPlayer.getColor()));
		
		//Corners
		zol.add(new GraphicTriangle(cps.getPoint(5), cps.getPoint(13), cps.getPoint(17), darker));
		zol.add(new GraphicTriangle(cps.getPoint(6), cps.getPoint(14), cps.getPoint(18), darker));
		zol.add(new GraphicTriangle(cps.getPoint(7), cps.getPoint(15), cps.getPoint(19), darker));
		zol.add(new GraphicTriangle(cps.getPoint(8), cps.getPoint(16), cps.getPoint(20), darker));

		zol.add(new GraphicTriangle(cps.getPoint(9), cps.getPoint(13), cps.getPoint(17), darker));
		zol.add(new GraphicTriangle(cps.getPoint(10), cps.getPoint(14), cps.getPoint(18), darker));
		zol.add(new GraphicTriangle(cps.getPoint(11), cps.getPoint(15), cps.getPoint(19), darker));
		zol.add(new GraphicTriangle(cps.getPoint(12), cps.getPoint(16), cps.getPoint(20), darker));
		
		//Main surface
		zol.add(new GraphicParallelogram(cps.getPoint(17), cps.getPoint(18), cps.getPoint(19), cps.getPoint(20), darker));
		
		//Supports
		zol.add(new GraphicTriangle(cps.getPoint(21), cps.getPoint(25), cps.getPoint(29), Color.black));
		zol.add(new GraphicTriangle(cps.getPoint(22), cps.getPoint(26), cps.getPoint(29), Color.black));
		zol.add(new GraphicTriangle(cps.getPoint(23), cps.getPoint(27), cps.getPoint(29), Color.black));
		zol.add(new GraphicTriangle(cps.getPoint(24), cps.getPoint(28), cps.getPoint(29), Color.black));
		
		//Orb
		zol.add(new GraphicTriangle(orb.getPoint(0), orb.getPoint(1), orb.getPoint(2), orbColor));
		zol.add(new GraphicTriangle(orb.getPoint(0), orb.getPoint(2), orb.getPoint(3), orbColor));
		zol.add(new GraphicTriangle(orb.getPoint(0), orb.getPoint(3), orb.getPoint(4), orbColor));
		zol.add(new GraphicTriangle(orb.getPoint(0), orb.getPoint(4), orb.getPoint(1), orbColor));

		zol.add(new GraphicTriangle(orb.getPoint(5), orb.getPoint(1), orb.getPoint(2), orbColor));
		zol.add(new GraphicTriangle(orb.getPoint(5), orb.getPoint(2), orb.getPoint(3), orbColor));
		zol.add(new GraphicTriangle(orb.getPoint(5), orb.getPoint(3), orb.getPoint(4), orbColor));
		zol.add(new GraphicTriangle(orb.getPoint(5), orb.getPoint(4), orb.getPoint(1), orbColor));

		cps.translate(vr[0]);
		cps.rotate(vr[0], Point3D.unitUp, i);
		ZListNode zln;
		int n=0;
		for(zln = zol.zNode; zln != null; zln = zln.getNext()) {
			n++;
		}
		ZListNode zlna[] = new ZListNode[n];
		n=0;
		for(zln = zol.zNode; zln != null; zln = zln.getNext()) {
			zlna[n++] = zln;
		}
		for(n=0;n<zlna.length;n++) {
			zlna[n].getThing().update();
		}
		zol.update();
	}
	public void draw(GameViewer v) {
		zol.draw(v);
	}
	public void addTo(GameViewer v) {
		v.add(zol);
	}
	public void killGraphics() {
		zol.kill();
	}
	
	protected void update() {
		if(health > 0 && action != 4) {
			orb.rotate(orb.getPoint(0), Point3D.unitUp, 7);
		}
		super.update();
	}
	
	protected void animateMove(){
		//Update the necessary vectors to move forward during one frame.
		int i = Trig.normalize(f * 60 + 30);
		Point3D pt = new Point3D(Trig.cos(i) * 2, Trig.sin(i) * 2,0);
		vr[0].doSum(pt);
		cps.translate(pt);
	}			
	protected void animateRotateLeft(){
		cps.rotate(vr[0], Point3D.unitUp, 10);
		ZListNode zln;
		int n=0;
		for(zln = zol.zNode; zln != null; zln = zln.getNext()) {
			n++;
		}
		ZListNode zlna[] = new ZListNode[n];
		n=0;
		for(zln = zol.zNode; zln != null; zln = zln.getNext()) {
			zlna[n++] = zln;
		}
		for(n=0;n<zlna.length;n++) {
			zlna[n].getThing().update();
		}
		zol.update();
	}
	protected void animateRotateRight(){
		cps.rotate(vr[0], Point3D.unitUp, 350);
		ZListNode zln;
		int n=0;
		for(zln = zol.zNode; zln != null; zln = zln.getNext()) {
			n++;
		}
		ZListNode zlna[] = new ZListNode[n];
		n=0;
		for(zln = zol.zNode; zln != null; zln = zln.getNext()) {
			zlna[n++] = zln;
		}
		for(n=0;n<zlna.length;n++) {
			zlna[n].getThing().update();
		}
		zol.update();
	}
	protected void animateMake() {
		orb.translate(Point3D.unitUp.getProduct(0.1f));
		orb.translate(Point3D.unitUp.getProduct(0.1f));
		orb.getPoint(0).doSum(Point3D.unitDown.getProduct(0.1f));
		orb.getPoint(1).doSum(Point3D.unitEast.getProduct(0.1f));
		orb.getPoint(2).doSum(Point3D.unitNorth.getProduct(0.1f));
		orb.getPoint(3).doSum(Point3D.unitWest.getProduct(0.1f));
		orb.getPoint(4).doSum(Point3D.unitSouth.getProduct(0.1f));
		orb.getPoint(5).doSum(Point3D.unitUp.getProduct(0.1f));
	}
	protected void animateDie() {
		if(frame == framesToDie())
			zol.explode((new Point3D(0,0,-5)).doSum(vr[0]));
		frame--;
		if(frame == 0)
		{
			zol.kill();
			remove();
			Hex.getHex(x,y).leave(this);
			Hex.getHex(resX,resY).unreserve();
		}
	}

	public float getHeight() {
		return orb.getPoint(5).z;
	}
	public float getWidth() {
		return 4.0f;
	}

	public float weaponRangeSquared(){
		return 14400.0f;
	}
	public int followRange(){
		return 5;
	}

	public int weaponDelay(){
		return 19;
	}

	protected boolean fire() {
		Point3D pt = new Point3D(targetSSMDS.getVector(this));
		pt.Normalize();
		pt.doProduct(5);
		pt.z = (target.getHeight() / 2f - cps.getPoint(35).z) * 5f / (float)Math.sqrt(targetSSMDS.getDistanceSquared());
		
		Projectile.newProjectile(new Paralyzer(Color.yellow), cps.getPoint(35), pt, 40, 25, 50, this, target);
		return true;

	}
	/** Unit default2 has a maximum of 120 health.
	 * @return 120
	 */
	protected int maxHealth() {
		return 75;
	}
	/** Unit default2 has an armor rating of 3
	 * @return 3
	 */
	protected int armor() {
                return 6;
	}
	/** Returns the cost to build this object.
	 * Non-buildable objects have a cost of zero.
	 * @return The cost of the object.
	 */
	public int cost() {
		return 250;
	}
	/** Target validation. If a target meets this criteria it can be acquired by scan().
	 * This version is for a stunning unit.
	 */
	protected boolean validTarget(GameObject go) {
		return (go.getPlayer() != null && go.getPlayer() != myPlayer && go.paralyzable());
	}
	protected boolean aim(){
		if(target == null) return false;
		if(target.getPlayer() == myPlayer)
			return false; //Don't shoot at own units, just follow them.
		if(!target.paralyzable()) {
			target = null;
			targetSSMDS = null;
			if(mode == 2)
				mode = 0;
			return false;
		}

		return true;
	}

}


?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av在线影院| 亚洲国产成人精品视频| 色婷婷av一区二区三区大白胸| 亚洲超碰97人人做人人爱| 欧美变态凌虐bdsm| 色婷婷精品久久二区二区蜜臀av | 肉色丝袜一区二区| 国产精品成人一区二区三区夜夜夜| 欧美久久久久久蜜桃| 成人激情小说网站| 毛片不卡一区二区| 日韩精品一区二区三区视频在线观看| www久久精品| 91麻豆精品久久久久蜜臀| 99久久亚洲一区二区三区青草| 久久97超碰色| 日韩成人一级大片| 亚洲综合丁香婷婷六月香| 日本一区二区视频在线| 日韩一区二区高清| 欧美老女人第四色| 欧美日韩在线综合| 欧洲精品中文字幕| 一本大道久久精品懂色aⅴ| 成人午夜在线播放| 国产成人99久久亚洲综合精品| 喷白浆一区二区| 日韩高清一区二区| 水野朝阳av一区二区三区| 亚洲午夜久久久久久久久久久| 国产精品久久影院| 国产欧美精品区一区二区三区 | 激情伊人五月天久久综合| 日韩激情一二三区| 偷拍亚洲欧洲综合| 五月天婷婷综合| 国产精品美女久久久久久久| 久久人人超碰精品| 国产精品资源网| 国产制服丝袜一区| 国产一区二区三区在线观看免费视频 | 99精品热视频| eeuss影院一区二区三区| 国v精品久久久网| 成人永久免费视频| www.综合网.com| 99久久久国产精品免费蜜臀| 白白色 亚洲乱淫| 91丨九色丨国产丨porny| 成人av集中营| 91福利精品视频| 欧美色图在线观看| 51午夜精品国产| 欧美电视剧免费观看| 精品三级av在线| 国产情人综合久久777777| 国产精品五月天| 亚洲天堂a在线| 亚洲成人在线网站| 久久国内精品自在自线400部| 精品一区二区三区免费| 国产一区二区0| 久久久久久久久久久久电影| 91精品午夜视频| 韩国成人福利片在线播放| 国产精品白丝jk黑袜喷水| 波多野结衣在线aⅴ中文字幕不卡| 99精品欧美一区二区蜜桃免费| 欧美做爰猛烈大尺度电影无法无天| 欧美日本不卡视频| 久久综合久色欧美综合狠狠| 中文字幕乱码日本亚洲一区二区| 自拍偷拍亚洲综合| 日韩在线一二三区| 国产一区二区三区精品欧美日韩一区二区三区| 国产在线观看免费一区| 99免费精品视频| 欧美日韩国产首页| 国产午夜亚洲精品理论片色戒| 亚洲色图丝袜美腿| 人人狠狠综合久久亚洲| 丁香桃色午夜亚洲一区二区三区| 色噜噜狠狠色综合中国| 欧美一区二区三区播放老司机| 国产视频911| 午夜免费欧美电影| 国产成人精品免费| 欧美男同性恋视频网站| 99综合电影在线视频| 欧美日韩国产影片| 国产成a人亚洲| 成人动漫一区二区三区| 欧美亚洲动漫制服丝袜| 久久久久亚洲蜜桃| 亚洲成人av电影| 99免费精品在线观看| 日韩视频123| 亚洲视频免费观看| 国产又粗又猛又爽又黄91精品| 欧美综合欧美视频| 国产精品乱码妇女bbbb| 欧美aaaaaa午夜精品| 91一区在线观看| 久久久久久久综合狠狠综合| 日韩国产欧美在线观看| 91天堂素人约啪| 国产人成一区二区三区影院| 日本女人一区二区三区| 在线精品亚洲一区二区不卡| 国产午夜三级一区二区三| 青青草原综合久久大伊人精品优势| 94-欧美-setu| 中文字幕av免费专区久久| 免费视频一区二区| 欧美日韩在线不卡| 亚洲三级电影全部在线观看高清| 国产资源精品在线观看| 欧美亚洲综合久久| 久久女同精品一区二区| 亚洲第一成人在线| 97久久超碰国产精品电影| 国产日产欧美精品一区二区三区| 日本不卡一区二区| 欧美日韩国产系列| 亚洲一二三四区不卡| 91丨国产丨九色丨pron| 亚洲欧洲色图综合| 不卡一卡二卡三乱码免费网站| 蜜臀av一区二区三区| 欧美挠脚心视频网站| 亚洲午夜精品在线| 色哟哟亚洲精品| 亚洲女同ⅹxx女同tv| 99久久精品免费观看| 国产精品久久三区| 99国产精品久久久久| 综合色天天鬼久久鬼色| jizz一区二区| 亚洲色图都市小说| 色哟哟欧美精品| 亚洲综合色视频| 欧美色综合久久| 天堂成人国产精品一区| 欧美日韩国产电影| 蜜臀精品一区二区三区在线观看| 日韩视频免费观看高清完整版| 美女一区二区久久| 久久这里只有精品首页| 国产精品久久久久久一区二区三区| 欧美在线观看禁18| 亚洲色图制服诱惑 | 国产精品第13页| 91麻豆蜜桃一区二区三区| 亚洲美女少妇撒尿| 欧美在线观看视频一区二区 | 一区二区三区欧美久久| 欧美视频中文字幕| 青娱乐精品视频| 亚洲精品一线二线三线| 丁香天五香天堂综合| 亚洲品质自拍视频| 欧美美女bb生活片| 激情综合色丁香一区二区| 久久久www成人免费毛片麻豆| 不卡av在线网| 五月综合激情婷婷六月色窝| 精品少妇一区二区三区| 成人h动漫精品一区二| 一区二区高清免费观看影视大全| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲国产视频直播| 一区二区三区在线观看视频| 国产拍欧美日韩视频二区| 国产欧美在线观看一区| 一区二区三区不卡视频在线观看| 亚洲免费观看视频| 欧美中文字幕一区二区三区亚洲| 欧美大片国产精品| 亚洲精品中文在线观看| 亚洲大片免费看| 99久久精品国产导航| 日韩中文字幕91| 国产亚洲人成网站| 欧美私人免费视频| 国产精品一区二区久激情瑜伽| 亚洲精品菠萝久久久久久久| 欧美成人vr18sexvr| 91蝌蚪porny| 精品亚洲porn| 亚洲国产精品天堂| 国产亚洲精品bt天堂精选| 欧美日韩精品福利| av高清久久久| 麻豆91免费观看| 亚洲最快最全在线视频| 日本一区二区三区dvd视频在线| 欧美日韩你懂得| www.成人在线| 亚洲国产日日夜夜| 日韩一级完整毛片|