Skip to content

Commit

Permalink
Fixed part editor crash, tech vulture bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jwvhewitt committed Apr 17, 2016
1 parent 611a0ee commit 0fd5074
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 50 deletions.
2 changes: 1 addition & 1 deletion arenascript.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3311,7 +3311,7 @@ implementation
until M2 = Nil;

M2 := SelectRandomGear( Mek^.SubCom );
if NotDestroyed( M2 ) and ( M2^.S <> GS_Body ) and ( RollStep( SkillValue( PC , 15 ) ) > 15 ) then begin
if NotDestroyed( M2 ) and CanBeExtracted( M2 ) and ( RollStep( SkillValue( PC , 15 ) ) > 15 ) then begin
DelinkGear( Mek^.SubCom , M2 );
SetNAtt( M2^.NA , NAG_Location , NAS_Team , NAV_DefPlayerTeam );
AppendGear( GB^.Meks , M2 );
Expand Down
1 change: 1 addition & 0 deletions backpack.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ interface
Function FindNextPC( GB: GameBoardPtr; CurrentPC: GearPtr; AllowPets: Boolean ): GearPtr;
Function FindPrevPC( GB: GameBoardPtr; CurrentPC: GearPtr; AllowPets: Boolean ): GearPtr;

Function CanBeExtracted( Item: GearPtr ): Boolean;

Procedure GivePartToPC( GB: GameBoardPtr; Part, PC: GearPtr );

Expand Down
2 changes: 2 additions & 0 deletions history.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- Mecha Part Editor crash fixed (sdlinfo.pp)
- Tech Vulture can't remove integral parts (arenascript.pp)
- In ASCII mode, cursor should indicate position of PC (conmap.pp)
- Fixed AutoTraining overspending bug (pcaction.pp)
- Renamed ifPersona ASL command to ifNPCOK
Expand Down
99 changes: 50 additions & 49 deletions sdlinfo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -1483,66 +1483,67 @@ implementation
MyDest := Z.GetRect();
SetInfoZone( MyDest );
AI_Title( FullGearName( Mek ), InfoHilight );
MyText := PrettyPrint( MassString( Mek ) + ' ' + FormName[Mek^.S] + ': ' + MsgString( 'FORMINFO_' + BStr( Mek^.S ) ) , MyDest.W, InfoHilight, True, Info_Font );
if MyText <> Nil then begin
CDest.X := CZone.X;
CDest.W := CZone.W;
SDL_SetClipRect( Game_Screen , @CZone );
SDL_BlitSurface( MyText , Nil , Game_Screen , @CDest );
CDest.Y := CDest.Y + MyText^.H + 8;
SDL_FreeSurface( MyText );
SDL_SetClipRect( Game_Screen , Nil );
end;
AI_PrintFromRight( MsgString('MEI_IntrinsicMass') + MakeMassString( IntrinsicMass(Mek), Mek^.Scale ) + ReplaceHash( MsgString('MEI_MVTRPenalty'),SgnStr(IntrinsicMVTVMod(Mek))), 0, InfoGreen);
AI_NextLine();
AI_PrintFromRight( MsgString('MEI_ExtrinsicMass') + MakeMassString( EquipmentMass(Mek), Mek^.Scale ) + ReplaceHash( MsgString('MEI_MVTRPenalty'),SgnStr(EquipmentMVTVMod(Mek))), 0, InfoGreen);
AI_NextLine();
AI_NextLine();

if BaseMoveRate( Mek, MM_Walk ) > 0 then begin
needed_pts := NeededLegPoints( mek );
active_pts := CountActivePoints( Mek , GG_Module , GS_Leg );
if active_pts > needed_pts then begin
AI_PrintFromRight( MsgString('MEI_LegPoints') + '100%+', 0, InfoGreen);
end else begin
AI_PrintFromRight( MsgString('MEI_LegPoints') + BStr((active_pts * 100 ) div needed_pts) + '%', 0, InfoGreen);
end;
if Mek^.G = GG_Mecha then begin
MyText := PrettyPrint( MassString( Mek ) + ' ' + FormName[Mek^.S] + ': ' + MsgString( 'FORMINFO_' + BStr( Mek^.S ) ) , MyDest.W, InfoHilight, True, Info_Font );
if MyText <> Nil then begin
CDest.X := CZone.X;
CDest.W := CZone.W;
SDL_SetClipRect( Game_Screen , @CZone );
SDL_BlitSurface( MyText , Nil , Game_Screen , @CDest );
CDest.Y := CDest.Y + MyText^.H + 8;
SDL_FreeSurface( MyText );
SDL_SetClipRect( Game_Screen , Nil );
end;
AI_PrintFromRight( MsgString('MEI_IntrinsicMass') + MakeMassString( IntrinsicMass(Mek), Mek^.Scale ) + ReplaceHash( MsgString('MEI_MVTRPenalty'),SgnStr(IntrinsicMVTVMod(Mek))), 0, InfoGreen);
AI_NextLine();
AI_PrintFromRight( MsgString('MEI_ExtrinsicMass') + MakeMassString( EquipmentMass(Mek), Mek^.Scale ) + ReplaceHash( MsgString('MEI_MVTRPenalty'),SgnStr(EquipmentMVTVMod(Mek))), 0, InfoGreen);
AI_NextLine();
AI_NextLine();
end;

if BaseMoveRate( Mek, MM_Roll ) > 0 then begin
needed_pts := NeededWheelPoints( mek );
active_pts := CountActivePoints( Mek , GG_MoveSys , GS_Wheels ) + CountActivePoints( Mek , GG_MoveSys , GS_Tracks );
if active_pts > needed_pts then begin
AI_PrintFromRight( MsgString('MEI_RollPoints') + '100%+', 0, InfoGreen);
end else begin
AI_PrintFromRight( MsgString('MEI_RollPoints') + BStr((active_pts * 100 ) div needed_pts) + '%', 0, InfoGreen);
if BaseMoveRate( Mek, MM_Walk ) > 0 then begin
needed_pts := NeededLegPoints( mek );
active_pts := CountActivePoints( Mek , GG_Module , GS_Leg );
if active_pts > needed_pts then begin
AI_PrintFromRight( MsgString('MEI_LegPoints') + '100%+', 0, InfoGreen);
end else begin
AI_PrintFromRight( MsgString('MEI_LegPoints') + BStr((active_pts * 100 ) div needed_pts) + '%', 0, InfoGreen);
end;
AI_NextLine();
end;
AI_NextLine();
end;

if BaseMoveRate( Mek, MM_Skim ) > 0 then begin
active_pts := CountThrustPoints( mek , MM_Skim , mek^.Scale );
if active_pts > 0 then begin
AI_PrintFromRight( MsgString('MEI_SkimThrust') + BStr(active_pts), 0, InfoGreen);
if BaseMoveRate( Mek, MM_Roll ) > 0 then begin
needed_pts := NeededWheelPoints( mek );
active_pts := CountActivePoints( Mek , GG_MoveSys , GS_Wheels ) + CountActivePoints( Mek , GG_MoveSys , GS_Tracks );
if active_pts > needed_pts then begin
AI_PrintFromRight( MsgString('MEI_RollPoints') + '100%+', 0, InfoGreen);
end else begin
AI_PrintFromRight( MsgString('MEI_RollPoints') + BStr((active_pts * 100 ) div needed_pts) + '%', 0, InfoGreen);
end;
AI_NextLine();
end;
end;

if BaseMoveRate( Mek, MM_Fly ) > 0 then begin
active_pts := FlightThrust( mek );
if BaseMoveRate( Mek, MM_Skim ) > 0 then begin
active_pts := CountThrustPoints( mek , MM_Skim , mek^.Scale );
if active_pts > 0 then begin
AI_PrintFromRight( MsgString('MEI_SkimThrust') + BStr(active_pts), 0, InfoGreen);
AI_NextLine();
end;
end;

if BaseMoveRate( Mek, MM_Fly ) > 0 then begin
active_pts := FlightThrust( mek );
if active_pts > 0 then begin
AI_PrintFromRight( MsgString('MEI_FlyThrust') + BStr(active_pts), 0, InfoGreen);
AI_NextLine();
end;
end;

active_pts := OverchargeBonus( mek );
if active_pts > 0 then begin
AI_PrintFromRight( MsgString('MEI_FlyThrust') + BStr(active_pts), 0, InfoGreen);
AI_PrintFromRight( MsgString('MEI_OverChargeBonus') + SgnStr(active_pts), 0, InfoGreen);
AI_NextLine();
end;
end;

active_pts := OverchargeBonus( mek );
if active_pts > 0 then begin
AI_PrintFromRight( MsgString('MEI_OverChargeBonus') + SgnStr(active_pts), 0, InfoGreen);
AI_NextLine();
end;

end;


Expand Down

0 comments on commit 0fd5074

Please sign in to comment.