Skip to content

Commit

Permalink
Added Claymore image
Browse files Browse the repository at this point in the history
  • Loading branch information
jwvhewitt committed Jan 20, 2018
1 parent 60b2c31 commit 0fecc52
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 32 deletions.
1 change: 1 addition & 0 deletions Design/Claymore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Battroid 6
Name <Claymore>
Desig <ITM-01>
SDL_Sprite <btr_claymore.png>
SDL_Portrait <mecha_claymore.png>
Desc <The Claymore is one of the oldest battroid mecha designs, dating from the Age of Superpowers. Though completely obsolete new Claymores are still being produced in DeadZone workshops.>

Mod Body
Expand Down
10 changes: 7 additions & 3 deletions GameData/messages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,11 @@ GENDER_3 <Undefined>
MAX_SPEED <Max: #>
PHONE_INSTRUCTIONS <Enter name or job of person to contact; * for redial.>
SELECTGENDER_NONBINARY <Don't try to define me>



ColorSet_0 <All Colors>
ColorSet_1 <Clothing>
ColorSet_2 <Skin>
ColorSet_3 <Hair>
ColorSet_4 <Primary>
ColorSet_5 <Secondary>
ColorSet_6 <Details>

Binary file added Image/aaGradientTest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Image/mecha_claymore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion Series/TS_GSP_Hermit_STORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Story
GoDelete <EndStory>
sub
Persona 3
greeting <NewChat ifG S2 4 else GoNoMaster Say 9 AddChat 4 Memo 0 History 13>
% V99 = History counter
greeting <NewChat ifG S2 4 else GoNoMaster Say 9 AddChat 4 Memo 0 if= V99 0 V= 99 1 History 13>
GoNoMaster <Say 1 AddChat 1 AddChat 2>

result1 <NewChat AddChat 3 S+ 2 1 if= d5 5 else GoR1_2 Say 2 SkillXP 1 * S1 100 SkillXP 6 * S1 100 Goto GoResetSign>
Expand Down
2 changes: 1 addition & 1 deletion Series/TS_MIL_Default_PLOT_Default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ sub
Msg16_3 <Our city is under attack! I need a mecha pilot to run a combat mission against \NARRATIVE 2 . How'd you like to help?>
Msg16_4 <There are mecha from \NARRATIVE 2 stationed just outside this city. I need a mecha pilot to run a combat mission against them. Interested?>
Msg16_5 <How would you like to perform a combat mission for \NARRATIVE 1 ?>
Msg16_6 <I should tell you that \NARRATIVE 2 needs a pilot for an upcoming mission. Interested?>
Msg16_6 <I should tell you that \NARRATIVE 1 needs a pilot for an upcoming mission. Interested?>
CMsg16_6 <ifG 0 NPCRep E2 3 Accept>
Msg16_7 <I've got a very important mission for you... \NARRATIVE 2 is at the gates of \NARRATIVE 3 , and we need a pilot to go take them out. Are you interested?>
CMsg16_7 <ifG 0 NPCRep E2 4 Accept>
Expand Down
45 changes: 24 additions & 21 deletions colormenu.pp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ implementation
cm_panel_width = 600;
cm_panel_height = 456;

cm_window_x = 100;
cm_window_y = 65;
cm_window_dx = -cm_panel_width div 2;
cm_window_dy = -230;

cm_image_x_offset = 20;
cm_image_y_offset = 20;
Expand All @@ -82,19 +82,19 @@ implementation
off_swatches_x = 3;
off_swatches_y = 19;

ZONE_colormenu_base: TSDL_Rect = ( x: cm_window_x; y: cm_window_y; w: cm_panel_width; h: cm_panel_height );
ZONE_colormenu_sprite: TSDL_Rect = ( x: cm_window_x + cm_image_x_offset; y: cm_window_y + cm_image_y_offset; w: 211; h: 308 );
ZONE_colormenu_base: DynamicRect = ( dx: cm_window_dx; dy: cm_window_dy; w: cm_panel_width; h: cm_panel_height; anchor: ANC_MIDDLE );
ZONE_colormenu_sprite: DynamicRect = ( dx: cm_image_x_offset+cm_window_dx; dy: cm_window_dy + cm_image_y_offset; w: 211; h: 308; anchor: ANC_MIDDLE );

ZONE_colorselectionboxes: Array [1..3] of TSDL_Rect = (
( x: cm_window_x + cm_swatchzone_x_offset; y: cm_window_y + cm_swatchzone_y_start; w: 600; h: 145 ),
( x: cm_window_x + cm_swatchzone_x_offset; y: cm_window_y + cm_swatchzone_y_start + cm_swatchzone_height; w: 600; h: 145 ),
( x: cm_window_x + cm_swatchzone_x_offset; y: cm_window_y + cm_swatchzone_y_start + 2 * cm_swatchzone_height; w: 600; h: 145 )
ZONE_colorselectionboxes: Array [1..3] of DynamicRect = (
( dx: cm_window_dx + cm_swatchzone_x_offset; dy: cm_window_dy + cm_swatchzone_y_start; w: 600; h: 145; anchor: ANC_MIDDLE ),
( dx: cm_window_dx + cm_swatchzone_x_offset; dy: cm_window_dy + cm_swatchzone_y_start + cm_swatchzone_height; w: 600; h: 145; anchor: ANC_MIDDLE ),
( dx: cm_window_dx + cm_swatchzone_x_offset; dy: cm_window_dy + cm_swatchzone_y_start + 2 * cm_swatchzone_height; w: 600; h: 145; anchor: ANC_MIDDLE )
);

ZONE_swatch_area: Array [1..3] of TSDL_Rect = (
( x: cm_window_x + cm_swatchzone_x_offset + off_swatches_x; y: cm_window_y + cm_swatchzone_y_start + off_swatches_y; w: Swatch_Width * Swatch_Columns; h: Swatch_Height * Swatch_Rows ),
( x: cm_window_x + cm_swatchzone_x_offset + off_swatches_x; y: cm_window_y + cm_swatchzone_y_start + cm_swatchzone_height + off_swatches_y; w: Swatch_Width * Swatch_Columns; h: Swatch_Height * Swatch_Rows ),
( x: cm_window_x + cm_swatchzone_x_offset + off_swatches_x; y: cm_window_y + cm_swatchzone_y_start + 2 * cm_swatchzone_height + off_swatches_y; w: Swatch_Width * Swatch_Columns; h: Swatch_Height * Swatch_Rows )
ZONE_swatch_area: Array [1..3] of DynamicRect = (
( dx: cm_window_dx + cm_swatchzone_x_offset + off_swatches_x; dy: cm_window_dy + cm_swatchzone_y_start + off_swatches_y; w: Swatch_Width * Swatch_Columns; h: Swatch_Height * Swatch_Rows; anchor: ANC_MIDDLE ),
( dx: cm_window_dx + cm_swatchzone_x_offset + off_swatches_x; dy: cm_window_dy + cm_swatchzone_y_start + cm_swatchzone_height + off_swatches_y; w: Swatch_Width * Swatch_Columns; h: Swatch_Height * Swatch_Rows; anchor: ANC_MIDDLE ),
( dx: cm_window_dx + cm_swatchzone_x_offset + off_swatches_x; dy: cm_window_dy + cm_swatchzone_y_start + 2 * cm_swatchzone_height + off_swatches_y; w: Swatch_Width * Swatch_Columns; h: Swatch_Height * Swatch_Rows; anchor: ANC_MIDDLE )
);

var
Expand Down Expand Up @@ -191,13 +191,14 @@ implementation
if colormenu_ReDrawer <> Nil then colormenu_ReDrawer;

{ Display the panel. }
ClearExtendedBorder( ZONE_colormenu_base );
SDL_FillRect( game_screen , @ZONE_colormenu_base , SDL_MapRGB( Game_Screen^.Format , PlayerBlue.R , PlayerBlue.G , PlayerBlue.B ) );
DrawSprite( cm_panel , ZONE_colormenu_base , 0 );
MyDest := ZONE_colormenu_base.GetRect();
ClearExtendedBorder( MyDest );
SDL_FillRect( game_screen , @MyDest , SDL_MapRGB( Game_Screen^.Format , PlayerBlue.R , PlayerBlue.G , PlayerBlue.B ) );
DrawSprite( cm_panel , MyDest , 0 );

{ Display the sprite we're editing. }
MySprite := ConfirmSprite( colormenu_imagename, colormenu_imagepalette, colormenu_imagewidth, colormenu_imageheight );
MyDest := ZONE_colormenu_sprite;
MyDest := ZONE_colormenu_sprite.GetRect();
if MySprite <> Nil then begin
MyDest.X := MyDest.X + ( MyDest.W div 2 ) - ( colormenu_imagewidth div 2 );
MyDest.Y := MyDest.Y + ( MyDest.H div 2 ) - ( colormenu_imageheight div 2 );
Expand All @@ -214,9 +215,9 @@ implementation
{ Display the three color swatch areas. }
for t := 1 to 3 do begin
if t = colormenu_channel then begin
DrawColorSelectionBox( ZONE_colorselectionboxes[t], colormenu_colorset[ t ], colormenu_currentpen[ t ], colormenu_rowoffset[ t ], colormenu_Curs_X, colormenu_Curs_Y );
DrawColorSelectionBox( ZONE_colorselectionboxes[t].GetRect(), colormenu_colorset[ t ], colormenu_currentpen[ t ], colormenu_rowoffset[ t ], colormenu_Curs_X, colormenu_Curs_Y );
end else begin
DrawColorSelectionBox( ZONE_colorselectionboxes[t], colormenu_colorset[ t ], colormenu_currentpen[ t ], colormenu_rowoffset[ t ], -1, -1 );
DrawColorSelectionBox( ZONE_colorselectionboxes[t].GetRect(), colormenu_colorset[ t ], colormenu_currentpen[ t ], colormenu_rowoffset[ t ], -1, -1 );
end;
end;
end;
Expand Down Expand Up @@ -252,15 +253,17 @@ implementation
{ Alright, so the mouse button has just been pressed. Figure out if it hit anything }
{ interesting and maybe change one of the color pens. }
var
MyHit: TSDL_Rect;
T,C,HitX,HitY: Integer;
begin
{ There are three color channels to worry about. See if it hit any of those. }
for t := 1 to 3 do begin
if ( Mouse_X >= ZONE_swatch_area[t].X ) and ( Mouse_Y >= ZONE_swatch_area[t].Y ) and ( Mouse_X < ( ZONE_swatch_area[t].X + ZONE_swatch_area[t].W ) ) and ( Mouse_Y < ( ZONE_swatch_area[t].Y + ZONE_swatch_area[t].H ) ) then begin
MyHit := ZONE_swatch_area[t].GetRect();
if ( Mouse_X >= MyHit.X ) and ( Mouse_Y >= MyHit.Y ) and ( Mouse_X < ( MyHit.X + MyHit.W ) ) and ( Mouse_Y < ( MyHit.Y + MyHit.H ) ) then begin
{ Alright, we're in the hit box. We've definitely hit a swatch, if there's one at this position. }
{ Determine HitX and HitY. }
HitX := ( Mouse_X - ZONE_swatch_area[t].X ) div Swatch_Width;
HitY := ( Mouse_Y - ZONE_swatch_area[t].Y ) div Swatch_Height;
HitX := ( Mouse_X - MyHit.X ) div Swatch_Width;
HitY := ( Mouse_Y - MyHit.Y ) div Swatch_Height;

{ Now the question becomes, is there a color at this area? }
colormenu_channel := T;
Expand Down
17 changes: 16 additions & 1 deletion gharena.pas
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{$IFNDEF DEBUG}
{$APPTYPE GUI}
{$ENDIF}
uses gears,sdlgfx,arenahq,sdlmenus,randchar,navigate,sdlmap;
uses gears,sdlgfx,arenahq,sdlmenus,randchar,navigate,sdlmap,ghchars;
{$ELSE}
uses gears,congfx,arenahq,conmenus,randchar,navigate,context,mapedit;
{$ENDIF}
Expand All @@ -45,6 +45,19 @@
{$IFDEF SDLMODE}
MyLogo: SensibleSpritePtr;

Procedure GenNames;
var
t: Integer;
mylist: SAttPtr;
begin
mylist := Nil;
for t := 1 to 10000 do begin
StoreSAtt( mylist, RandomName );
end;
SaveStringList( 'names.txt', mylist );
DisposeSAtt( mylist );
end;

Procedure MainMenuRedraw;
{ Draw the opening screen, and add the infobox + logo. }
begin
Expand Down Expand Up @@ -76,6 +89,8 @@
AddRPGMenuItem( RPM , 'View Design Files' , 7 );
AddRPGMenuItem( RPM , 'Quit Game' , -1 );

{GenNames();}

repeat
{$IFNDEF SDLMODE}
ClrScreen;
Expand Down
5 changes: 5 additions & 0 deletions history.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
- Fixed problem with SanitizeFilename on Windows (pcaction.pp,navigate.pp)
- Some illegal characters removed from filenames (texutil.pp)
- FillRectWithSprite can now accept x,y offsets (sdlgfx.pp)
- ColorMenu is properly centered when screen is resized (colormenu.pp)

1.302 June 26 2016
- Fixed lone enemy bug in SCENE_CaptureMecha.txt
- Updated PLOT_BanditJob1.txt, PLOT_BanditJob2.txt, PLOT_BanditJob3.txt,
Expand Down
4 changes: 3 additions & 1 deletion pcaction.pp
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,9 @@ implementation
end;

{ Find the PC's name, open the file, and save. }
Name := Save_Campaign_Base + PilotName( PC ) + Default_File_Ending;
Name := PilotName( PC );
SanitizeFilename( Name );
Name := Save_Campaign_Base + Name + Default_File_Ending;
Assign( F , Name );
Rewrite( F );
WriteCampaign( Camp , F );
Expand Down
6 changes: 5 additions & 1 deletion randchar.pp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ implementation
while ( Leader <> Nil ) and ( ( Leader^.G <> GG_Character ) or ( NAttValue( Leader^.NA , NAG_CharDescription , NAS_CharType ) <> 0 ) ) do Leader := Leader^.Next;
if Leader = Nil then Exit;

FName := Save_Character_Base + GearName(Leader) + Default_File_Ending;
FName := GearName( Leader );
SanitizeFilename( FName );

FName := Save_Character_Base + FName + Default_File_Ending;

Assign( F , FName );
Rewrite( F );
WriteCGears( F , PC );
Expand Down
17 changes: 15 additions & 2 deletions sdlgfx.pp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ interface
ZONE_ShopText: DynamicRect = ( dx:-225; dy: -230; w: 287; h: 170; anchor: ANC_middle );
ZONE_ShopPCName: DynamicRect = ( dx:-330; dy: -30; w: 100; h: 32; anchor: ANC_middle );
ZONE_ShopPCPortrait: DynamicRect = ( dx:-330; dy: -10; w: 100; h: 150; anchor: ANC_middle );
ZONE_ShopMenu: DynamicRect = ( dx:-225; dy: -30; w: 287; h: 190; anchor: ANC_middle );
ZONE_ShopMenu: DynamicRect = ( dx:-225; dy: -30; w: 287; h: 170; anchor: ANC_middle );

ZONE_ShopInfo: DynamicRect = (dx:85; dY:-225; W: 250; H: 340; anchor: ANC_middle);
ZONE_ShopCash: DynamicRect = ( dx:135; dy: 130; w: 150; h: 16; anchor: ANC_middle );
Expand Down Expand Up @@ -199,6 +199,10 @@ procedure DrawSprite( Spr: SensibleSpritePtr; MyDest: TSDL_Rect; Frame: Integer
procedure DrawAlphaSprite( Spr: SensibleSpritePtr; MyDest: TSDL_Rect; Frame: Integer );
Function ConfirmSprite( Name: String; const Color: String; W,H: Integer ): SensibleSpritePtr;

Procedure FillRectWithSprite( MyRect: TSDL_Rect; MySprite: SensibleSpritePtr; MyFrame,OffX,OffY: Integer );
Procedure FillRectWithSprite( MyRect: TSDL_Rect; MySprite: SensibleSpritePtr; MyFrame: Integer );


function RPGKey: Char;
Procedure ClrZone( var Z: TSDL_Rect );
Procedure ClrScreen;
Expand Down Expand Up @@ -1069,7 +1073,7 @@ function RPGKey: Char;
GrowRect := MyRect;
end;

Procedure FillRectWithSprite( MyRect: TSDL_Rect; MySprite: SensibleSpritePtr; MyFrame: Integer );
Procedure FillRectWithSprite( MyRect: TSDL_Rect; MySprite: SensibleSpritePtr; MyFrame,OffX,OffY: Integer );
{ Fill this area of the screen perfectly with the provided sprite. }
var
MyDest: TSDL_Rect;
Expand All @@ -1079,6 +1083,9 @@ function RPGKey: Char;
GridH := MyRect.H div MySprite^.H + 1;
SDL_SetClipRect( Game_Screen , @MyRect );

MyRect.X := MyRect.X + (OffX mod MySprite^.W) - MySprite^.W;
MyRect.Y := MyRect.Y + (OffY mod MySprite^.H) - MySprite^.H;

{ Draw the backdrop. }
for X := 0 to GridW do begin
MyDest.X := MyRect.X + X * MySprite^.W;
Expand All @@ -1091,6 +1098,12 @@ function RPGKey: Char;
SDL_SetClipRect( Game_Screen , Nil );
end;

Procedure FillRectWithSprite( MyRect: TSDL_Rect; MySprite: SensibleSpritePtr; MyFrame: Integer );
{ Do a FillRect with offset 0,0. }
begin
FillRectWithSprite( MyRect, MySprite, MyFrame, 0, 0 );
end;

Procedure InfoBox( MyBox: TSDL_Rect );
{ Do a box for drawing something else inside of. }
const
Expand Down
1 change: 0 additions & 1 deletion sdlinfo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,6 @@ implementation
CDest := ZONE_PCInfo;

{ Error check }
{ Note that we want the area cleared, even in case of an error. }
if Part = Nil then exit;

{ Depending upon PART's type, branch to an appropriate procedure. }
Expand Down
17 changes: 17 additions & 0 deletions texutil.pp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ interface
Procedure ReplacePat( var msg: String; const pat_in,s: String );
Function ReplaceHash( const msg, s: String ): String;

Procedure SanitizeFilename( var S: String );


implementation

Expand Down Expand Up @@ -393,4 +395,19 @@ function IsAlpha( C: Char ): Boolean;
ReplaceHash := msg_out;
end;

Procedure SanitizeFilename( var S: String );
{ Replace all proscribed characters with an underscore. }
const
ProscribedCharacters = ',?"*~#%&{}:<>+|';
var
T: Integer;
begin
for T := 1 to Length( S ) do begin
if Pos( S[T] , ProscribedCharacters ) > 0 then begin
S[T] := '_';
end;
end;
end;


end.

0 comments on commit 0fecc52

Please sign in to comment.