All pastes #801245 Raw Edit

danmakufu

public text v1 · immutable
#801245 ·published 2007-11-29 03:14 UTC
rendered paste body
#東方弾幕風
#Title[Mima Regular 1]
#Text[testing...]
#BackGround[Default]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {

    let CSD        = GetCurrentScriptDirectory;
    let ShotData   = CSD ~ "shot_All.txt";
	let start = 120;
	let angle = 0;
	let xconstant = 20;
	let yconstant = 10;
	let angle2 = 0;
	let angle3;
	let number = 0;
	let speed = 2.5;
	let speed2 = 3;
	let delay1 = 60;
	let delay2 = 180;
	let ImgBoss = "script\img\Reimu.png";
	let Shot = 17;
	let Shot2 = 24;

	@Initialize {

		SetInvincibility( 120 );
		SetLife(4000);
		SetTimer(50);
	
		SetMovePosition02(GetCenterX, GetClipMinY + 120, 0);

		LoadGraphic(ImgBoss);
		SetTexture(ImgBoss);
		SetGraphicRect(0, 0, 62, 62);
		LoadUserShotData(ShotData);
		TMain;
	}

	@MainLoop {
		SetCollisionA(GetX, GetY, 32);
		SetCollisionB(GetX, GetY, 16);		
		yield;
	}

	@DrawLoop {
        DrawGraphic(GetX, GetY);
    }

	@Finalize {
        DeleteGraphic(ImgBoss);
    }

	task TMain {
		wait(start);
		loop {
			CircleofStars();
			wait(delay1);
			HolyCrap();
			wait(delay2);
		}
	}

	function CircleofStars() {
		let TypeShot = Shot;
		angle = GetAngleToPlayer;
		loop(10) {
			loop(60) {
				CreateShot01(GetX, GetY, speed, angle, TypeShot, 0);
				angle += 360/60
			}
			speed -= 0.2;
		}
		speed = 2.5
	}

	function HolyCrap() {
		let TypeShot2 = Shot2;
		angle2 = rand(0,360);
		angle3 = 0;
		loop(2) {
			loop(100) {
				if ((angle3 % 360 == 0) && xconstant == 20) {
					xconstant = 10;
				}
				CreateShot01(GetX + (xconstant * cos(angle3)), GetY + (yconstant * sin(angle3)), speed2, angle2, TypeShot2, 0); 
				angle3 += 360/100;
				angle2 += 360/100;
				if (angle3 % 720 <= 360) {
					xconstant = 10;
					yconstant = 20;
				}
				if (angle3 % 720 >= 360) {
					xconstant = 20;
					yconstant = 10;
				}
			}
			speed2 = 1;
		}
		speed2 = 2;
	}

	function wait(w) {
        loop(w) { yield; }
    }
}