diff options
author | brunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-02-19 17:18:42 +0000 |
---|---|---|
committer | brunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-02-19 17:18:42 +0000 |
commit | 51ed8fe6f2ea9892e905e81cf5bad3960537eb40 (patch) | |
tree | a4dcb099343762dcb7bd7988f73de68c1959d3a5 /Modis | |
download | usdx-51ed8fe6f2ea9892e905e81cf5bad3960537eb40.tar.gz usdx-51ed8fe6f2ea9892e905e81cf5bad3960537eb40.tar.xz usdx-51ed8fe6f2ea9892e905e81cf5bad3960537eb40.zip |
Challenge MOD r7 alpha based on Ultrastar Deluxe v1.0.1a
for changes read Changelog.txt in folder Game
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2107 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Modis')
-rw-r--r-- | Modis/5000Points/Until5000.dpr | 91 | ||||
-rw-r--r-- | Modis/5000Points/Until5000.identcache | bin | 0 -> 121 bytes | |||
-rw-r--r-- | Modis/Blind/Blind.dpr | 102 | ||||
-rw-r--r-- | Modis/Don't_Get_Worse/Hold_The_Line.dpr | 212 | ||||
-rw-r--r-- | Modis/Duell/Duell.dpr | 99 | ||||
-rw-r--r-- | Modis/SDK/ModiSDK.dcu | bin | 0 -> 4173 bytes | |||
-rw-r--r-- | Modis/SDK/ModiSDK.pas | 160 | ||||
-rw-r--r-- | Modis/SDK/StrUtils.pas | 70 | ||||
-rw-r--r-- | Modis/Team_Duell/TeamDuell.dpr | 237 |
9 files changed, 971 insertions, 0 deletions
diff --git a/Modis/5000Points/Until5000.dpr b/Modis/5000Points/Until5000.dpr new file mode 100644 index 00000000..b826d212 --- /dev/null +++ b/Modis/5000Points/Until5000.dpr @@ -0,0 +1,91 @@ +library Until5000;
+
+uses
+ ModiSDK in '..\SDK\ModiSDK.pas';
+
+//Gave the Plugins Info
+procedure PluginInfo (var Info: TPluginInfo); stdcall;
+begin
+ Info.Name := 'PLUGIN_UNTIL5000_NAME';
+
+ Info.Creator := 'Whiteshark';
+ Info.PluginDesc := 'PLUGIN_UNTIL5000_DESC';
+
+ //Set to Party Modi Plugin
+ Info.Typ := 8;
+
+ Info.NumPlayers := 31;
+ //Options
+ Info.LoadSong := True; //Whether or not a Song should be Loaded
+ //Only When Song is Loaded:
+ Info.ShowScore := True; //Whether or not the Score should be shown
+ Info.ShowNotes := True; //Whether the Note Lines should be displayed
+ Info.LoadVideo := True; //Should the Video be loaded ?
+ Info.LoadBack := True; //Should the Background be loaded ?
+
+ Info.BGShowFull := False; //Whether the Background or the Video should be shown Fullsize
+ Info.BGShowFull_O := True; //Whether the Background or the Video should be shown Fullsize
+
+ Info.ShowRateBar:= True; //Whether the Bar that shows how good the player was sould be displayed
+ Info.ShowRateBar_O := True; //Load from Ini whether the Bar should be Displayed
+
+ Info.EnLineBonus := False; //Whether LineBonus Should be enabled
+ Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled
+
+ //Options even when song is Not loaded
+ Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn
+ Info.TeamModeOnly := False; //If True the Plugin can only be Played in Team Mode
+ Info.GetSoundData := False; //If True the RData Procedure is called when new SoundData is available
+ Info.Dummy := False; //Should be Set to False... for Updateing Plugin Interface
+end;
+
+//Executed on Game Start //If True Game begins, else Failure
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
+begin
+Result := True;
+end;
+
+//Executed everytime the Screen is Drawed //If False The Game finishes
+function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+var
+I: Integer;
+begin
+Result := False;
+ for I := 0 to PlayerInfo.NumPlayers-1 do
+ begin
+ PlayerInfo.Playerinfo[I].Bar := PlayerInfo.Playerinfo[I].Score div 50;
+ PlayerInfo.Playerinfo[I].Percentage := PlayerInfo.Playerinfo[I].Bar;
+ if (PlayerInfo.Playerinfo[I].Score >=5000) then
+ Exit;
+ end;
+Result := True;
+end;
+
+//Is Executed on Finish, Returns the Playernum of the Winner
+function Finish (var Playerinfo: TPlayerinfo): byte; stdcall;
+var
+ I:Integer;
+begin
+Result := 0;
+for I := 0 to PlayerInfo.NumPlayers-1 do
+ begin
+ if (PlayerInfo.Playerinfo[I].Score >=5000) then
+ begin
+ Case I of
+ 0: Result := Result OR 1;
+ 1: Result := Result OR 2;
+ 2: Result := Result OR 4;
+ 3: Result := Result OR 8;
+ 4: Result := Result OR 16;
+ 5: Result := Result OR 32;
+ end;
+ end;
+ end;
+end;
+
+exports
+PluginInfo, Init, Draw, Finish;
+
+begin
+
+end.
\ No newline at end of file diff --git a/Modis/5000Points/Until5000.identcache b/Modis/5000Points/Until5000.identcache Binary files differnew file mode 100644 index 00000000..80f58a39 --- /dev/null +++ b/Modis/5000Points/Until5000.identcache diff --git a/Modis/Blind/Blind.dpr b/Modis/Blind/Blind.dpr new file mode 100644 index 00000000..c806171d --- /dev/null +++ b/Modis/Blind/Blind.dpr @@ -0,0 +1,102 @@ +library Blind;
+
+uses
+ ModiSDK in '..\SDK\ModiSDK.pas';
+
+//Gave the Plugins Info
+procedure PluginInfo (var Info: TPluginInfo); stdcall;
+begin
+ Info.Name := 'PLUGIN_BLIND_NAME';
+
+ Info.Creator := 'Whiteshark';
+ Info.PluginDesc := 'PLUGIN_BLIND_DESC';
+
+ //Set to Party Modi Plugin
+ Info.Typ := 8;
+
+ Info.NumPlayers := 31;
+
+ //Options
+ Info.LoadSong := True; //Whether or not a Song should be Loaded
+ //Only When Song is Loaded:
+ Info.ShowScore := True; //Whether or not the Score should be shown
+ Info.ShowNotes := False; //Whether the Note Lines should be displayed
+ Info.LoadVideo := True; //Should the Video be loaded ?
+ Info.LoadBack := True; //Should the Background be loaded ?
+
+ Info.BGShowFull := False; //Whether the Background or the Video should be shown Fullsize
+ Info.BGShowFull_O := True; //Whether the Background or the Video should be shown Fullsize
+
+ Info.ShowRateBar:= False; //Whether the Bar that shows how good the player was sould be displayed
+ Info.ShowRateBar_O := True; //Load from Ini whether the Bar should be Displayed
+
+ Info.EnLineBonus := False; //Whether LineBonus Should be enabled
+ Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled
+
+ //Options even when song is Not loaded
+ Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn
+ Info.TeamModeOnly := False; //If True the Plugin can only be Played in Team Mode
+ Info.GetSoundData := False; //If True the RData Procedure is called when new SoundData is available
+ Info.Dummy := False; //Should be Set to False... for Updateing Plugin Interface
+end;
+
+//Executed on Game Start //If True Game begins, else Failure
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
+begin
+Result := True;
+end;
+
+//Executed everytime the Screen is Drawed //If False The Game finishes
+function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+var
+I: Integer;
+begin
+Result := True;
+end;
+
+//Is Executed on Finish, Returns the Playernum of the Winner
+function Finish (var Playerinfo: TPlayerinfo): byte; stdcall;
+var
+ I:Integer;
+ MaxScore: Word;
+begin
+ Result := 0;
+ MaxScore := 0;
+ for I := 0 to PlayerInfo.NumPlayers-1 do
+ begin
+ PlayerInfo.Playerinfo[I].Percentage := PlayerInfo.Playerinfo[I].Score div 9999;
+ if (PlayerInfo.Playerinfo[I].Score > MaxScore) then
+ begin
+ MaxScore := PlayerInfo.Playerinfo[I].Score;
+ Case I of
+ 0: Result := 1;
+ 1: Result := 2;
+ 2: Result := 4;
+ 3: Result := 8;
+ 4: Result := 16;
+ 5: Result := 32;
+ end;
+ end
+ else if (PlayerInfo.Playerinfo[I].Score = MaxScore) AND (PlayerInfo.Playerinfo[I].Score <> 0) then
+ begin
+ Case I of
+ 0: Result := Result OR 1;
+ 1: Result := Result OR 2;
+ 2: Result := Result OR 4;
+ 3: Result := Result OR 8;
+ 4: Result := Result OR 16;
+ 5: Result := Result OR 32;
+ end;
+ end;
+ end;
+ //If everybody has 0 Points nobody Wins
+ If (MaxScore = 0) then
+ Result := 0;
+end;
+
+exports
+PluginInfo, Init, Draw, Finish;
+
+begin
+
+end.
\ No newline at end of file diff --git a/Modis/Don't_Get_Worse/Hold_The_Line.dpr b/Modis/Don't_Get_Worse/Hold_The_Line.dpr new file mode 100644 index 00000000..de19858b --- /dev/null +++ b/Modis/Don't_Get_Worse/Hold_The_Line.dpr @@ -0,0 +1,212 @@ +library Hold_The_Line;
+
+uses
+ ModiSDK in '..\SDK\ModiSDK.pas',
+ StrUtils in '..\SDK\StrUtils.pas',
+ OpenGL12,
+ Windows;
+
+var
+ PointerTex: TSmallTexture;
+ CountSentences: Cardinal;
+ Limit: Byte;
+ MethodRec: TMethodRec;
+ Frame: Integer;
+ PlayerTimes: array[0..5] of Integer;
+ LastTick: Cardinal;
+ PointerVisible: Boolean;
+
+ DismissedSound: Cardinal;
+
+//Gave the Plugins Info
+procedure PluginInfo (var Info: TPluginInfo); stdcall;
+begin
+ Info.Name := 'PLUGIN_HDL_NAME';
+
+ Info.Creator := 'Whiteshark';
+ Info.PluginDesc := 'PLUGIN_HDL_DESC';
+
+ //Set to Party Modi Plugin
+ Info.Typ := 8;
+
+ Info.NumPlayers := 31;
+ //Options
+ Info.LoadSong := True; //Whether or not a Song should be Loaded
+ //Only When Song is Loaded:
+ Info.ShowScore := True; //Whether or not the Score should be shown
+ Info.ShowNotes := True; //Whether the Note Lines should be displayed
+ Info.LoadVideo := True; //Should the Video be loaded ?
+ Info.LoadBack := True; //Should the Background be loaded ?
+
+ Info.BGShowFull := False; //Whether the Background or the Video should be shown Fullsize
+ Info.BGShowFull_O := True; //Whether the Background or the Video should be shown Fullsize
+
+ Info.ShowRateBar:= True; //Whether the Bar that shows how good the player was sould be displayed
+ Info.ShowRateBar_O := False; //Load from Ini whether the Bar should be Displayed
+
+ Info.EnLineBonus := False; //Whether LineBonus Should be enabled
+ Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled
+
+ //Options even when song is Not loaded
+ Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn
+ Info.TeamModeOnly := False; //If True the Plugin can only be Played in Team Mode
+ Info.GetSoundData := False; //If True the RData Procedure is called when new SoundData is available
+ Info.Dummy := False; //Should be Set to False... for Updateing Plugin Interface
+end;
+
+//Executed on Game Start //If True Game begins, else Failure
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
+var
+ I: Integer;
+ Texname, TexType: PChar;
+begin
+ TexName := CreateStr(PChar('HDL_Pointer'));
+ TexType := CreateStr(PChar('Font Black'));
+ PointerTex := Methods.LoadTex(TexName, TexType);
+
+ FreeStr(TexName);
+ FreeStr(TexType);
+
+ TexName := CreateStr(PChar('dismissed.mp3'));
+ DismissedSound := Methods.LoadSound (TexName);
+ FreeStr(TexName);
+
+ CountSentences := Sentences.High;
+ Limit := 0;
+ Frame := 0;
+
+ MethodRec := Methods;
+
+ for I := 0 to PlayerInfo.NumPlayers-1 do
+ begin
+ PlayerInfo.Playerinfo[I].Enabled := True;
+ PlayerInfo.Playerinfo[I].Percentage := 100;
+ PlayerTimes[I] := 0;
+ end;
+
+ LoadOpenGL;
+
+ Result := True;
+end;
+
+//Executed everytime the Screen is Drawed //If False The Game finishes
+function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+var
+ I: Integer;
+ L: Byte;
+ C: Byte;
+ Text: PChar;
+ Blink: Boolean;
+ tick: Cardinal;
+begin
+ //Aktivate Blink
+ If (CurSentence = CountSentences div 5 * 2 - 1) OR (CurSentence = CountSentences div 3 * 2 - 1) then
+ begin
+ Tick := Gettickcount div 400;
+ If (Tick <> LastTick) then
+ begin
+ LastTick := Tick;
+ PointerVisible := Not PointerVisible;
+ end;
+ end
+ else
+ PointerVisible := True;
+
+ //Inc Limit
+ if (Limit = 0) And (CurSentence >= CountSentences div 5 * 2) then
+ Inc(Limit)
+ else if (Limit = 1) And (CurSentence >= CountSentences div 3 * 2) then
+ Inc(Limit);
+
+ case Limit of
+ 0: L := 20;
+ 1: L := 50;
+ 2: L := 75;
+ end;
+
+ C:= 0;
+
+ Result := True;
+
+ for I := 0 to PlayerInfo.NumPlayers-1 do
+ begin
+ if PlayerInfo.Playerinfo[I].Enabled then
+ begin
+ if PlayerInfo.Playerinfo[I].Bar < L then
+ begin
+ PlayerInfo.Playerinfo[I].Enabled := False;
+ Inc(C);
+ PlayerTimes[I] := CurSentence; //Save Time of Dismission
+ //PlaySound
+ MethodRec.PlaySound (DismissedSound);
+ end;
+
+ //Draw Pointer
+ if (PointerVisible) then
+ begin
+ glColor4f (0.2, 0.8, 0.1, 1);
+
+ glEnable(GL_TEXTURE_2D);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ glBindTexture(GL_TEXTURE_2D, PointerTex.TexNum);
+
+ glBegin(GL_QUADS);
+ glTexCoord2f(1/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY - 4);
+ glTexCoord2f(1/32, 1); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY + 12);
+ glTexCoord2f(31/32, 1); glVertex2f(PlayerInfo.Playerinfo[I].PosX+ L + 3, PlayerInfo.Playerinfo[I].PosY + 12);
+ glTexCoord2f(31/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX+ L + 3, PlayerInfo.Playerinfo[I].PosY - 4);
+ glEnd;
+
+ glDisable(GL_TEXTURE_2D);
+ glDisable(GL_BLEND);
+ end;
+
+ end
+ else
+ begin
+ Inc(C);
+ //Draw Dismissed
+ Text := CreateStr(PChar('PARTY_DISMISSED'));
+
+ glColor4f (0.8, 0.8, 0.8, 1);
+
+ MethodRec.Print (1, 6, PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY-8, Text);
+ FreeStr(Text);
+ end;
+ end;
+ if (C >= PlayerInfo.NumPlayers-1) then
+ Result := False;
+end;
+
+//Is Executed on Finish, Returns the Playernum of the Winner
+function Finish (var Playerinfo: TPlayerinfo): byte; stdcall;
+var
+ I:Integer;
+begin
+Result := 0;
+for I := 0 to PlayerInfo.NumPlayers-1 do
+ begin
+ PlayerInfo.Playerinfo[I].Percentage := (PlayerTimes[I] * 100) div CountSentences;
+ if (PlayerInfo.Playerinfo[I].Enabled) then
+ begin
+ PlayerInfo.Playerinfo[I].Percentage := 100;
+ Case I of
+ 0: Result := Result OR 1;
+ 1: Result := Result OR 2;
+ 2: Result := Result OR 4;
+ 3: Result := Result OR 8;
+ 4: Result := Result OR 16;
+ 5: Result := Result OR 32;
+ end;
+ end;
+ end;
+end;
+
+exports
+PluginInfo, Init, Draw, Finish;
+
+begin
+
+end.
\ No newline at end of file diff --git a/Modis/Duell/Duell.dpr b/Modis/Duell/Duell.dpr new file mode 100644 index 00000000..cff9d4ef --- /dev/null +++ b/Modis/Duell/Duell.dpr @@ -0,0 +1,99 @@ +library Duell;
+
+uses
+ ModiSDK in '..\SDK\ModiSDK.pas';
+
+//Gave the Plugins Info
+procedure PluginInfo (var Info: TPluginInfo); stdcall;
+begin
+ Info.Name := 'PLUGIN_DUELL_NAME';
+
+ Info.Creator := 'Whiteshark';
+ Info.PluginDesc := 'PLUGIN_DUELL_DESC';
+
+ Info.Typ := 8;
+
+ Info.NumPlayers := 31;
+ //Options
+ Info.LoadSong := True; //Whether or not a Song should be Loaded
+ //Only When Song is Loaded:
+ Info.ShowScore := True; //Whether or not the Score should be shown
+ Info.ShowNotes := True; //Whether the Note Lines should be displayed
+ Info.LoadVideo := True; //Should the Video be loaded ?
+ Info.LoadBack := True; //Should the Background be loaded ?
+
+ Info.BGShowFull := False; //Whether the Background or the Video should be shown Fullsize
+ Info.BGShowFull_O := True; //Whether the Background or the Video should be shown Fullsize
+
+ Info.ShowRateBar:= False; //Whether the Bar that shows how good the player was sould be displayed
+ Info.ShowRateBar_O := True; //Load from Ini whether the Bar should be Displayed
+
+ Info.EnLineBonus := False; //Whether LineBonus Should be enabled
+ Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled
+
+ //Options even when song is Not loaded
+ Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn
+ Info.TeamModeOnly := False; //If True the Plugin can only be Played in Team Mode
+ Info.GetSoundData := False; //If True the RData Procedure is called when new SoundData is available
+ Info.Dummy := False; //Should be Set to False... for Updateing Plugin Interface
+end;
+
+//Executed on Game Start //If True Game begins, else Failure
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
+begin
+Result := True;
+end;
+
+//Executed everytime the Screen is Drawed //If False The Game finishes
+function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+begin
+Result := True;
+end;
+
+//Is Executed on Finish, Returns the Playernum of the Winner
+function Finish (var Playerinfo: TPlayerinfo): byte; stdcall;
+var
+ I:Integer;
+ MaxScore: Word;
+begin
+ Result := 0;
+ MaxScore := 0;
+ for I := 0 to PlayerInfo.NumPlayers-1 do
+ begin
+ PlayerInfo.Playerinfo[I].Percentage := PlayerInfo.Playerinfo[I].Score div 9999;
+ if (PlayerInfo.Playerinfo[I].Score > MaxScore) then
+ begin
+ MaxScore := PlayerInfo.Playerinfo[I].Score;
+ Case I of
+ 0: Result := 1;
+ 1: Result := 2;
+ 2: Result := 4;
+ 3: Result := 8;
+ 4: Result := 16;
+ 5: Result := 32;
+ end;
+ end
+ else if (PlayerInfo.Playerinfo[I].Score = MaxScore) AND (PlayerInfo.Playerinfo[I].Score <> 0) then
+ begin
+ Case I of
+ 0: Result := Result OR 1;
+ 1: Result := Result OR 2;
+ 2: Result := Result OR 4;
+ 3: Result := Result OR 8;
+ 4: Result := Result OR 16;
+ 5: Result := Result OR 32;
+ end;
+ end;
+ end;
+
+ //When nobody has Points -> Everybody loose
+ if (MaxScore = 0) then
+ Result := 0;
+end;
+
+exports
+PluginInfo, Init, Draw, Finish;
+
+begin
+
+end.
\ No newline at end of file diff --git a/Modis/SDK/ModiSDK.dcu b/Modis/SDK/ModiSDK.dcu Binary files differnew file mode 100644 index 00000000..1b6e82a1 --- /dev/null +++ b/Modis/SDK/ModiSDK.dcu diff --git a/Modis/SDK/ModiSDK.pas b/Modis/SDK/ModiSDK.pas new file mode 100644 index 00000000..7f260c64 --- /dev/null +++ b/Modis/SDK/ModiSDK.pas @@ -0,0 +1,160 @@ +unit ModiSDK;
+
+interface
+
+type //PluginInfo, for Init
+ TPluginInfo = record
+ //Info
+ Name: Array [0..32] of Char; //Modi to Register for the Plugin
+ Creator: Array [0..32] of Char; //Name of the Author
+ PluginDesc: Array [0..64] of Char; //Plugin Description
+
+ //Plugin Typ, atm: 8 only for PartyMode Modi
+ Case Typ: byte of
+ 8: (
+ //Options
+ LoadSong: boolean; //Whether or not a Song should be Loaded
+ //Only When Song is Loaded:
+ ShowNotes: boolean; //Whether the Note Lines should be displayed
+ LoadVideo: boolean; //Should the Video be loaded ?
+ LoadBack: boolean; //Should the Background be loaded ?
+
+ ShowRateBar: boolean; //Whether the Bar that shows how good the player was sould be displayed
+ ShowRateBar_O: boolean; //Load from Ini whether the Bar should be Displayed
+
+ EnLineBonus: boolean; //Whether LineBonus Should be enabled
+ EnLineBonus_O: boolean; //Load from Ini whether LineBonus Should be enabled
+
+ BGShowFull: boolean; //Whether the Background or the Video should be shown Fullsize
+ BGShowFull_O: boolean; //Whether the Background or the Video should be shown Fullsize
+
+ //Options -> everytime
+ ShowScore: boolean; //Whether or not the Score should be shown
+ ShowBars: boolean; //Whether the White Bars on Top and Bottom should be Drawn
+ TeamModeOnly: boolean; //If True the Plugin can only be Played in Team Mode
+ GetSoundData: boolean; //If True the RData Procedure is called when new SoundData is available
+ Dummy: boolean; //Should be Set to False... for Updateing Plugin Interface
+
+ NumPlayers: Byte //Number of Available Players for Modi
+ //Set different Bits
+ //1 -> One Player
+ //2 -> Two Players
+ //4 -> Three Players
+ //8 -> Four Players
+ //16-> Six Players
+ //e.g. : 10 -> Playable with 2 and 4 Players
+ );
+
+ end;
+
+ TPlayerInfo = record
+ NumPlayers: Byte;
+ Playerinfo: array[0..5] of record
+ Name: PChar; //Name of the Player
+ Score:Word; //Players Score
+ Bar: Byte; //Percentage of the SingBar filled
+ PosX: Real; //PosX of Players SingBar
+ PosY: Real; //PosY "
+ Enabled: Boolean; //Whether the Player could get Points
+ Percentage: Byte; //Percentage Shown on the Score Screen
+ end;
+ end;
+
+ TTeamInfo = record
+ NumTeams: Byte;
+ Teaminfo: array[0..5] of record
+ Name: PChar;
+ Score: Word;
+ Joker: Byte;
+ CurPlayer: Byte;
+ NumPlayers: Byte;
+ Playerinfo: array[0..3] of record
+ Name: PChar;
+ TimesPlayed: Byte;
+
+ end;
+ end;
+ end;
+
+ TPlayersInfo = record
+ NumPlayer: byte;
+ Playerinfo: array[0..8] of record
+ Name: PChar;
+ ScoreP: Integer;
+ ScoreN: Integer;
+ Wins: byte;
+ Defeats: byte;
+ Draws: byte;
+ Points: Integer;
+ Joker: byte;
+ NumPlayed: byte;
+ end;
+ end;
+
+ TsmallTexture = record
+ TexNum: integer;
+ W: real;
+ H: real;
+ end;
+
+ TSentences = record
+ Akt: integer; // aktualna czesc utworu do rysowania
+ High: integer;
+ Ilosc: integer;
+ Resolution: integer;
+ NotesGAP: integer;
+ TotalLength: integer;
+ Sentence: array of record
+ Start: integer;
+ StartNote: integer;
+ Lyric: string;
+ LyricWidth: real;
+ Koniec: integer;
+ BaseNote: integer;
+ HighNote: integer;
+ IlNut: integer;
+ TotalNotes: integer;
+ Note: array of record
+ Color: integer;
+ Start: integer;
+ Length: integer;
+ Ton: integer;
+ TonGamy: integer;
+ //Text: string;
+ FreeStyle: boolean;
+ Typ: integer; // zwykla nuta x1, zlota nuta x2
+ end;
+ end;
+ end;
+
+ DWORD = Longword;
+ HSTREAM = DWORD;
+
+ //Routines to gave to the Plugin
+ fModi_LoadTex = function (const Name, Typ: PChar): TsmallTexture; stdcall; //Pointer to Texture Loader
+ //fModi_Translate = function (const Name, Translation: AChar): Integer; stdcall; //Pointer to Translator
+ fModi_Print = procedure (const Style, Size: Byte; const X, Y: Real; const Text: PChar); stdcall; //Procedure to Print Text //Now translated automatically
+ fModi_LoadSound = function (const Name: PChar): Cardinal; stdcall; //Procedure that loads a Custom Sound
+ pModi_PlaySound = procedure (const Index: Cardinal); stdcall; //Plays a Custom Sound
+
+ TMethodRec = record
+ LoadTex: fModi_LoadTex;
+ Print: fModi_Print;
+ LoadSound: fModi_LoadSound;
+ PlaySound: pModi_PlaySound;
+ end;
+ //DLL Funktionen
+ //Gave the Plugins Info
+ pModi_PluginInfo = procedure (var Info: TPluginInfo); stdcall;
+ //Executed on Game Start //If True Game begins, else Failure
+ fModi_Init = function (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
+ //Executed everytime the Screen is Drawed //If False The Game finishes
+ fModi_Draw = function (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+ //Is Executed on Finish, Returns the Playernum of the Winner
+ fModi_Finish = function (var Playerinfo: TPlayerinfo): byte; stdcall;
+ //Procedure called when new Sound Data is available
+ pModi_RData = procedure (handle: HSTREAM; buffer: Pointer; len: DWORD; user: DWORD); stdcall;
+
+implementation
+
+end.
diff --git a/Modis/SDK/StrUtils.pas b/Modis/SDK/StrUtils.pas new file mode 100644 index 00000000..276d95a2 --- /dev/null +++ b/Modis/SDK/StrUtils.pas @@ -0,0 +1,70 @@ +unit StrUtils;
+
+interface
+uses ModiSDK;
+
+//function StrToAChar(Str: String): AChar;
+function CreateStr(Str: PChar): PChar;
+procedure FreeStr(Str: PChar);
+
+implementation
+
+{function StrToAChar(Str: String): AChar;
+var
+ L, I: Integer;
+begin
+ L := Length(Str);
+ For I := 0 to L-1 do
+ AChar[I] := Str[I+1];
+
+ For I := L to 254 do
+ AChar[I] := #0;
+end; }
+
+function StrCopy(Dest, Source: PChar): PChar; assembler;
+asm
+ PUSH EDI
+ PUSH ESI
+ MOV ESI,EAX
+ MOV EDI,EDX
+ MOV ECX,0FFFFFFFFH
+ XOR AL,AL
+ REPNE SCASB
+ NOT ECX
+ MOV EDI,ESI
+ MOV ESI,EDX
+ MOV EDX,ECX
+ MOV EAX,EDI
+ SHR ECX,2
+ REP MOVSD
+ MOV ECX,EDX
+ AND ECX,3
+ REP MOVSB
+ POP ESI
+ POP EDI
+end;
+
+function StrLen(Str: PChar): Cardinal; assembler;
+asm
+ MOV EDX,EDI
+ MOV EDI,EAX
+ MOV ECX,0FFFFFFFFH
+ XOR AL,AL
+ REPNE SCASB
+ MOV EAX,0FFFFFFFEH
+ SUB EAX,ECX
+ MOV EDI,EDX
+end;
+
+function CreateStr(Str: PChar): PChar;
+begin
+ GetMem(Result, StrLen(Str) + 1);
+ StrCopy(Result, Str);
+end;
+
+procedure FreeStr(Str: PChar);
+begin
+ FreeMem(Str);
+end;
+
+end.
\ No newline at end of file diff --git a/Modis/Team_Duell/TeamDuell.dpr b/Modis/Team_Duell/TeamDuell.dpr new file mode 100644 index 00000000..5b90e8ad --- /dev/null +++ b/Modis/Team_Duell/TeamDuell.dpr @@ -0,0 +1,237 @@ +library TeamDuell ;
+
+uses
+ ModiSDK in '..\SDK\ModiSDK.pas',
+ StrUtils in '..\SDK\StrUtils.pas',
+ sysutils,
+ OpenGL12,
+ Windows;
+
+var
+ TeamPlayer: array of array of String;
+ StartPoints: array of integer;
+ CurSinger, NextSinger: array[0..2] of Integer;
+ MethodRec: TMethodRec;
+ SPT, PlayerSelected: array[0..2] of Integer;
+ TtoNextChange, starttick, endtick, ChangeOnSentence : Cardinal;
+ bps, RTtoNextChange: Double;
+ firsttime, secondtime: boolean;
+
+
+//Gave the Plugins Info
+procedure PluginInfo (var Info: TPluginInfo); stdcall;
+begin
+ Info.Name := 'PLUGIN_TEAMDUELL_NAME';
+
+ Info.Creator := 'jekatt';
+ Info.PluginDesc := 'PLUGIN_TEAMDUELL_DESC';
+
+ Info.Typ := 8;
+
+ Info.NumPlayers := 31;
+ //Options
+ Info.LoadSong := True; //Whether or not a Song should be Loaded
+ //Only When Song is Loaded:
+ Info.ShowScore := True; //Whether or not the Score should be shown
+ Info.ShowNotes := True; //Whether the Note Lines should be displayed
+ Info.LoadVideo := True; //Should the Video be loaded ?
+ Info.LoadBack := True; //Should the Background be loaded ?
+
+ Info.BGShowFull := False; //Whether the Background or the Video should be shown Fullsize
+ Info.BGShowFull_O := True; //Whether the Background or the Video should be shown Fullsize
+
+ Info.ShowRateBar:= True; //Whether the Bar that shows how good the player was sould be displayed
+ Info.ShowRateBar_O := false; //Load from Ini whether the Bar should be Displayed
+
+ Info.EnLineBonus := False; //Whether LineBonus Should be enabled
+ Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled
+
+ //Options even when song is Not loaded
+ Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn
+ Info.TeamModeOnly := True; //If True the Plugin can only be Played in Team Mode
+ Info.GetSoundData := False; //If True the RData Procedure is called when new SoundData is available
+ Info.Dummy := False; //Should be Set to False... for Updateing Plugin Interface
+end;
+
+//Executed on Game Start //If True Game begins, else Failure
+function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall;
+var
+I,J: Integer;
+begin
+ // Get beginning of sentences
+ for I := 0 to Sentences.High do begin
+ SetLength(Startpoints, I+1);
+ Startpoints[I]:=Sentences.Sentence[I].Start;
+ end;
+ // Get Teams and Players
+ for I := 0 to TeamInfo.NumTeams-1 do
+ begin
+ SetLength(TeamPlayer, I+1);
+ for J := 0 to TeamInfo.Teaminfo[I].NumPlayers-1 do
+ begin
+ SetLength(TeamPlayer[I], J+1);
+ TeamPlayer[I,J] := Copy(String(TeamInfo.Teaminfo[I].Playerinfo[J].Name),1,8);
+ If (NOT(TeamPlayer[I,J] = (String(TeamInfo.Teaminfo[I].Playerinfo[J].Name)))) THEN TeamPlayer[I,J] := TeamPlayer[I,J]+'.';
+ SPT[I]:=J+1;
+ end;
+ CurSinger[I] := TeamInfo.Teaminfo[I].CurPlayer;
+ repeat
+ NextSinger[I] := random(SPT[I]);
+ until NOT(NextSinger[I] = CurSinger[I]) OR (SPT[I] = 1) ;
+ end;
+ ChangeOnSentence := 8;
+ starttick := GetTickCount;
+ firsttime := true;
+ secondtime := true;
+ bps := 1;
+ MethodRec := Methods;
+ LoadOpenGL;
+ Result := True;
+end;
+
+//Executed everytime the Screen is Drawed //If False The Game finishes
+function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall;
+var
+ I,timeline,x,y: Integer;
+ display: PChar;
+ start: boolean;
+begin
+ // TickCount(firstSentence) (not zero!)
+ If (CurSentence = ChangeOnSentence - 7) AND (firsttime) then
+ begin
+ firsttime := false;
+ starttick := GetTickCount;
+ end;
+ start := false;
+ // show first singers for 5sec
+ if (CurSentence < 1) AND ((starttick + 5000) > GetTickCount) then begin start := true; end;
+
+ // TickCount(thirdSentence)
+ If (CurSentence = 3) AND (secondtime) then
+ begin
+ secondtime := false;
+ firsttime := true;
+ endtick := GetTickCount;
+ bps := (Startpoints[3]-Startpoints[1]) * 1000 / (endtick-starttick); // BeatsPerSecond
+ end;
+
+ // Time to next Change
+ RTtoNextChange := ((Startpoints[ChangeOnSentence]-Startpoints[ChangeOnSentence - 7]) / bps) - ((GetTickCount - starttick) / 1000);
+ TtoNextChange := Trunc(RTtoNextChange) +1;
+
+ // Next Singer for Team I
+ for I := 0 to High(TeamPlayer) do begin
+ if (CurSentence = ChangeOnSentence) AND NOT(PlayerSelected[I] = CurSentence) then begin
+ PlayerSelected[I] := CurSentence;
+ CurSinger[I] := NextSinger[I];
+ repeat
+ NextSinger[I] := random(SPT[I]);
+ until NOT(NextSinger[I] = CurSinger[I]) OR (SPT[I] = 1) ;
+ end;
+
+ // display bg
+ glColor4f (0.8, 0.8, 0.8, 1);
+ display := PChar(TeamPlayer[I,CurSinger[I]]);
+ if (TtoNextChange <= 11) OR (start = true) Then begin
+ glEnable(GL_TEXTURE_2D);
+ glDisable(GL_BLEND);
+ glColor4f (0, 0, 0, 1);
+ glBegin(GL_QUADS);
+ glVertex2f(PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY+8);
+ glVertex2f(PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY + 30);
+ glVertex2f(PlayerInfo.Playerinfo[I].PosX + 100, PlayerInfo.Playerinfo[I].PosY + 30);
+ glVertex2f(PlayerInfo.Playerinfo[I].PosX + 100, PlayerInfo.Playerinfo[I].PosY+8);
+ glEnd;
+ display := 'Next Singer';
+
+ // timeline
+ x:= 270; y:= 472;
+ if (TtoNextChange <= 5) AND (RTtoNextChange > 0) then begin
+ timeline := Trunc(RTtoNextChange*50);
+ glColor3f (0, 0, 0);
+ glBegin(GL_QUADS);
+ glVertex2f(x, y);
+ glVertex2f(x, y+18);
+ glVertex2f(x+6+250, y+18);
+ glVertex2f(x+6+250, y);
+ glEnd;
+ glColor3f (0.2, 0.2, 0.2);
+ glBegin(GL_QUADS);
+ glVertex2f(x+3, y+3);
+ glVertex2f(x+3, y+15);
+ glVertex2f(x+3+250, y+15);
+ glVertex2f(x+3+250, y+3);
+ glEnd;
+ glColor3f (0.8, 0.2, 0.2);
+ glBegin(GL_QUADS);
+ glColor3f (0.9, 0, 0); glVertex2f(x+3, y+3);
+ glColor3f (0.8, 0.3, 0.3); glVertex2f(x+3, y+15);
+ glColor3f (0.8, 0.3, 0.3); glVertex2f(x+3+timeline, y+15);
+ glColor3f (0.9, 0, 0); glVertex2f(x+3+timeline, y+3);
+ glEnd;
+ end;
+ glDisable(GL_TEXTURE_2D);
+ end;
+
+ // Names, Timer
+ if (TtoNextChange <= 9) Then begin display := PChar(TeamPlayer[I,NextSinger[I]]);
+ glColor4f (0.8, 0.1, 0.2, 1);
+ MethodRec.Print (1, 6, PlayerInfo.Playerinfo[I].PosX+85, PlayerInfo.Playerinfo[I].PosY+10, CreateStr(PChar(IntToStr(Trunc(TtoNextChange)))));
+ end;
+ glColor4f (0.8, 0.8, 0.8, 1);
+ if (CurSentence = 0) then display := PChar(TeamPlayer[I,CurSinger[I]]);
+ if (TtoNextChange <= 11) OR (start) Then MethodRec.Print (1, 6, PlayerInfo.Playerinfo[I].PosX+5, PlayerInfo.Playerinfo[I].PosY+10, display);
+ end;
+ if (CurSentence = ChangeOnSentence) then begin ChangeOnSentence := CurSentence + 7; firsttime := true; end;
+Result := True;
+end;
+
+//Is Executed on Finish, Returns the Playernum of the Winner
+function Finish (var Playerinfo: TPlayerinfo): byte; stdcall;
+var
+ I:Integer;
+ MaxScore: Word;
+begin
+ Result := 0;
+ MaxScore := 0;
+ for I := 0 to PlayerInfo.NumPlayers-1 do
+ begin
+ PlayerInfo.Playerinfo[I].Percentage := PlayerInfo.Playerinfo[I].Score div 9999;
+ if (PlayerInfo.Playerinfo[I].Score > MaxScore) then
+ begin
+ MaxScore := PlayerInfo.Playerinfo[I].Score;
+ Case I of
+ 0: Result := 1;
+ 1: Result := 2;
+ 2: Result := 4;
+ 3: Result := 8;
+ 4: Result := 16;
+ 5: Result := 32;
+ end;
+ end
+ else if (PlayerInfo.Playerinfo[I].Score = MaxScore) AND (PlayerInfo.Playerinfo[I].Score <> 0) then
+ begin
+ Case I of
+ 0: Result := Result OR 1;
+ 1: Result := Result OR 2;
+ 2: Result := Result OR 4;
+ 3: Result := Result OR 8;
+ 4: Result := Result OR 16;
+ 5: Result := Result OR 32;
+ end;
+ end;
+ end;
+
+ //When nobody has Points -> Everybody loose
+ if (MaxScore = 0) then
+ Result := 0;
+end;
+
+exports
+PluginInfo, Init, Draw, Finish;
+
+begin
+
+end.
+
+
|