📄 kota43b.pas
字号:
unit Kota43b;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, math, Defs,
DDRaw,DDDD,DDSD,DSound,AlphaLib;
type //PlayData
TPlayData = record
PlayData : array[0..60000] of Byte; //PlayData 60001
Name : string[3]; //Name 4
playerType : Byte; //Type 1
score : LongInt; //score 4
Dif : shortint; //擄堈搙 1
Stage : Byte; //Stage 1 = 60012
end;
type
TCONFIG = record //擄堈搙 弴埵
Flag : array [0..32] of Byte;
end;
type //Score
TScore = record //擄堈搙 弴埵
Name : array [0..5,0..9] of string[3]; //1*4 * 6 * 10 = 240
Score: array [0..5,0..9] of LongInt; //4 * 6 * 10 = 240
PlayType : array [0..5,0..9] of Byte; //1 * 6 * 10 = 60
Stage : array[0..5,0..9] of Byte; //1 * 6 * 10 = 60;
end;
type
TStageData = record
PartsFile : String[255];
FromLine : Word; //儖亅僾梡
ToLine : Word;
MD : array[0..6,0..511] of Byte; //50x50=1Cell
ED : array[0..5,0..511] of Byte;
end;
type
TImageBank = record //夋憸僶儞僋
width,height : Integer;
col,row : Byte; //楍丄峴
maskEmpty : boolean;
Empty : boolean;
Img : TDDDDSurFace;
Msk : TDDDDSurFace;
end;
type
TSoundBank = record //岠壥壒僶儞僋
FileName : string;
OutPut : Byte;
Empty : Boolean;
WAVData : TDDSDWaveData;
Play : Boolean;
end;
type
TEnemy = record //揋偝傫梡
x,y,z : SmallInt;
x1,y1,x2,y2 : SmallInt;
a1,a2,a3,a4,a5 : Integer;
h1,h2,h3,h4 : SmallInt;
Shot : Boolean;
Move : Byte;
ATTK : Byte;
BOM : Byte;
Kind : Byte;
HP : Integer;
Hit : Byte;
Empty: Boolean;
score: Integer;
end;
type
TPlayer = record //僾儗僀儎亅
x,y : Integer;
x1,y1,x2,y2 : SmallInt;
a1,a2,a3,a4 : Integer;
h1,h2,h3,h4 : SmallInt;
Nomber : Byte;
Hit : Boolean;
NoHit : Integer;
Empty : Boolean;
score : LongInt;
bom : Byte;
PNo : Byte;
HP : Byte;
SLevel : Integer;
SelectNo : Byte;
Speed1,Speed2 : Byte;
AddENS : Byte;
Name : String[3];
end;
type
TEnemyShot = record //揋偺抏
x,y : Integer;
x1,y1,x2,y2 : SmallInt;
a1,a2,a3,a4 : Integer;
h1,h2,h3,h4 : SmallInt;
Kind : Byte;
Empty: Boolean;
end;
type
TPlayerShot = record //僾儗僀儎亅偺抏
x,y : Integer;
x1,y1 : SmallInt;
a1,a2,a3 : Integer;
HitNo : SmallInt;
h1,h2,h3,h4 : SmallInt;
Kind : Byte;
Power: Byte;
Empty: Boolean;
end;
type
TBom = record //敋敪張棟
x,y : SmallInt;
x1,y1 : SmallInt;
a1,a2,a3 : Integer;
Kind : Byte;
Empty: Boolean;
end;
type
TEffect = record //僄僼僃僋僩岠壥
x,y : SmallInt;
x1,y1 : SmallInt;
a1,a2,a3 : Integer;
Kind : Byte;
Empty: Boolean;
end;
type
TItem = record //傾僀僥儉
x,y : SmallInt;
x1,y1 : SmallInt;
Kind : Byte;
Empty: Boolean;
end;
type //揰悢梡僼僅儞僩
TSTGFont = record
x,y : SmallInt;
x1,y1 : SmallInt;
Count : LongInt;
TextNo : array [0..40] of Byte;
TextWidth : Integer;
opt : Byte;
Empty : Boolean;
end;
type //bossParts
TBossPartsData = record
x,y,z : Smallint;
x1,y1,x2,y2,x3,y3 : Integer;
a1,a2,a3,a4 : Integer;
HP,MaxHP : Integer;
h1,h2,h3,h4 : SmallInt;
lx,ly : SmallInt;
Link : Boolean;
bom : Byte;
Score : Integer;
Level : Byte;
Empty : Boolean;
kind : Byte;
Hit : Byte;
ImageNo : Byte;
count : Integer;
Ex : Integer;
end;
type
TSTG = Class(Tobject)
private
public
SD : TStageData;
ConfigData : TCONFIG;
BOD: array[0..10] of TBossPartsData;
ED : array[0..50] of TEnemy;
PD : array[0..2] of TPlayer;
ESD: array[0..210] of TEnemyShot;
PSD: array[0..75] of TPlayerShot;
IB : array[0..40] of TImageBank;
SB : array[0..20] of TSoundBank;
BD : array[0..75] of TBom;
SC : array[0..720] of SmallInt;
TD : array[0..50] of TSTGFont;
EFD: array[0..75] of TEffect;
ID : array[0..25] of TItem;
SCR: TScore;
PlayChar : TDDDDSurface; //僉儍儔偺婄
PlayMes : array[0..22] of string; //僙儕僼
//EnemySwap
EnemyNo : Byte;
ESwap : array[0..50] of Byte;
BSwap : array[0..10] of Byte;
//count
DB,DE,DES,DPS : SmallInt;
BDCount : Integer;
PDCount : Integer;
//SE
DSoundNo : array[0..7] of Byte;
DSoundPlay: array[0..7] of Boolean;
//stage
BossName : string;
BackGround : TDDDDSurFace;
SCount,BSCount : Integer;
PBank : TDDDDSurFace;
Pentry : boolean;
PBX,PBY : Integer;
PSpeed : Integer;
StageClear : Boolean;
StageNo : Integer;
//昞帵梡價僢僩儅僢僾
ENSBit : TDDDDSurFace;
BHPBit : TDDDDSurFace;
Layer : TDDDDSurFace;
BackBuf : TDDDDSurFace;
TempBuf : TDDDDSurFace;
STBack : TDDDDSurFace;
//儊僢僙亅僕昞帵梡
MCount : Integer;
MNo : Byte;
//揰柵惂屼
FlashCount : Byte;
BossFlash : Integer;
AnimeCount : Byte;
//config
SEOff : Byte; // 0 or 1(False)
Dif : ShortInt; //擄堈搙 (0=Normal)
BackESD : Byte;
BossLevel : Byte;
BackCut : Byte; //攚宨偺摟夁張棟
WaveVolume : Byte;
//pointsystem
DestroyEnemy : Integer;
PointScore : Integer;
MaxComb,NoMiss : Integer;
//Plater 1Up
BackScore : LongInt;
//DirectDraw Wait Asinc
DDFLG : Byte;
//Error
ErrorCode : Byte;
//BackGround
BackGroundkind : Byte;
BackGroundStep : Integer;
//SpecialEffect(墶僽儗)
SPEX : Integer;
SPEX2: Integer;
//儊僢僙乣僕僀儀儞僩
mesivent : Byte;
constructor Create; //弶婜愝掕
destructor Destroy; //夝曻張棟
function ConfigRead : Boolean;
procedure ConfigWrite;
procedure DataClear;
procedure PlaySTG;
procedure Masking(x1,x2 : TBitmap);
procedure EntryBank(FileName : String;
w,h, c,r, No : Integer; mask,mem : boolean);
procedure DrawBank(x,y : Integer;
c,r, No,opt : Byte);
procedure EntryPlayerShot(x,y,ax,ay,h1,h2,h3,h4 : SmallInt;
kind,pw : Byte);
procedure MovePlayerShot;
procedure EntryBom(x,y,ax,ay : SmallInt;
kind : Byte);
procedure MoveBom;
procedure EntryEnemyShot(x,y,ax,ay,h1,h2,h3,h4,a2 : SmallInt;
kind : Byte);
procedure MoveEnemyShot;
procedure AutoEnemyShot(x,y : SmallInt; kind : Byte; opt : Integer);
procedure EntryEnemy(x,y,z,h1,h2,h3,h4,a2,a3,HP : SmallInt; move,attk,bom,kind : Byte; score:Integer);
procedure MoveEnemy;
procedure AutoEnemy(x,y : SmallInt; kind : Byte);
procedure EntrySoundBank(FileName : String;
OutPut,No : Byte);
procedure EntrySound(No : Byte);
procedure EntryEffect(x,y,x1,y1 : SmallInt; kind : Byte);
procedure MoveEffect;
function keisan1(x,y : Integer) : Integer;
function PlayerLong(x,y : Integer) : Integer;
function PlayerHit : Boolean;
function EnemyHit : Boolean;
procedure Draw;
procedure EntryStage(FileName : String; Stage : Integer);
procedure SetUpStage(Speed : Integer);
procedure MoveStage;
procedure MoveMessage;
procedure EntryPText(x,y : Integer; Text : String; opt : byte);
procedure MovePText;
procedure StrMid1(Var DsStr : String;
Var SsStr : String;
a,b : Integer);
procedure LoadBoss(filename : string; Stage : Byte);
procedure EntryBoss;
procedure MoveBoss;
procedure SettingBoss(stage : Byte);
procedure BossHit;
procedure BossDestroy(kind : Byte);
procedure PlayerDestroy;
procedure EnemyShotClear;
procedure DataClear2;
procedure DrawFont(x,y : Integer; mes : string; opt : Byte);
procedure PlaySE;
procedure EntryItem(x,y : SmallInt; Kind : Byte);
procedure MoveItem;
procedure SurFaceClear(src : TDDDDSurFace; color : LongInt);
procedure PutBackFace(src : TDDDDSurFace;x,y : Integer;
rd : Trect; opt : Byte);
procedure WaveDraw(rc : TRect;Count : Integer);
procedure MoveFlash;
procedure DrawBackGround;
procedure SetBackGround(FileName : String; Kind : Byte);
procedure MoveBackGround;
procedure Clear;
procedure SpecialEffect;
procedure SpecialEffect2;
procedure MaskColor(Dest : TDDDDSurface; rc : Trect;
DestCol,SrcCol : Integer);
procedure LoadPlayData(filename : string; var aaa : TPlayData);
procedure savePlayData(filename : string; var aaa : TPlayData);
procedure LoadPlayerMes(Filename : string);
procedure DrawBom;
end;
implementation
constructor TSTG.Create; //弶婜愝掕
var
iii,jjj : Integer;
ff : FILE;
begin
inherited Create;
BackBuf := TDDDDSurFace.CreateOnSystemMemory(DD,300,300,0);
TempBuf := TDDDDSurFace.CreateOnSystemMemory(DD,450,450,0);
STBack := TDDDDSurFace.Create(DD,300,350,0);
BackBuf.ClipRect := rect(0,0,300,300);
BackBuf.Clipping := True;
STBack.ClipRect := rect(0,0,300,350);
STBack.Clipping := True;
for iii := 0 to 40 do
IB[iii].Empty := False;
//嶰妏娭悢傪寁嶼
for iii := 0 to 720 do
begin
SC[iii] := round(sin(3.141592*(iii*0.5)/180)*100);
end;
for iii := 0 to 7 do
begin
DSoundNo[iii] := 255;
DSoundPlay[iii] := False;
end;
for iii := 0 to 20 do
begin
SB[iii].Empty := False;
end;
DataClear;
SCount := 0;
PSpeed := 1;
if (FileExists('bmp\ENS.bmp') = False)then begin ErrorCode := 255; exit; end;
ENSBit := TDDDDSurFace.CreateOnSystemMemory(DD,75,16,0);
ENSBit.LoadBMP('bmp\ENS.bmp');
if (FileExists('bmp\BossHP.bmp') = False)then begin ErrorCode := 255; exit; end;
BHPBit := TDDDDSurFace.CreateOnSystemMemory(DD,200,10,0);
BHPBit.LoadBMP('bmp\BossHP.bmp');
if (FileExists('bmp\Layer1.bmp') = False)then begin ErrorCode := 255; exit; end;
Layer := TDDDDSurFace.CreateOnSystemMemory(DD,300,15,0);
Layer.LoadBMP('bmp\Layer1.bmp');
if (FileExists('bmp\char.bmp') = False)then begin ErrorCode := 255; exit; end;
PlayChar := TDDDDSurFace.CreateOnSystemMemory(DD,160,480,0);
PlayChar.LoadBMP('bmp\char.bmp');
//config
SEOff := 0;
dif := 0;
Mcount := 0;
PDCount := 0;
BDCount := 0;
BackCut := 0;
WaveVolume := 0;
//DirectDraw Flag
DDFLG := 0;
//Hiscore
PointScore := 100;
BackScore := 0;
//Error
ErrorCode := 0;
//BitMapEnpty;
PEntry := False;
for iii := 0 to 5 do for jjj := 0 to 9 do
begin
SCR.score[iii,jjj] := 0;
SCR.NAME[iii,jjj] := 'XXX';
SCR.Stage[iii,jjj] := 0;
SCR.PlayType[iii,jjj] := 0;
end;
if (FileExists('hisc.scr') = true)then
begin
assignfile(ff,'hisc.scr');
ReSet(ff,1);
blockRead(ff,SCR,600);
closefile(ff);
end;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -