diff --git a/arenascript.pp b/arenascript.pp index 0a68b98..bf3a7c5 100644 --- a/arenascript.pp +++ b/arenascript.pp @@ -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 ); diff --git a/backpack.pp b/backpack.pp index 067917f..953e767 100644 --- a/backpack.pp +++ b/backpack.pp @@ -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 ); diff --git a/history.txt b/history.txt index 1a262f3..64cc530 100644 --- a/history.txt +++ b/history.txt @@ -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 diff --git a/sdlinfo.pp b/sdlinfo.pp index 9fe7ea7..eb8d198 100644 --- a/sdlinfo.pp +++ b/sdlinfo.pp @@ -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;