diff --git a/Design/Alba.txt b/Design/Alba.txt index f0d4a68..a237dab 100644 --- a/Design/Alba.txt +++ b/Design/Alba.txt @@ -8,6 +8,7 @@ Mod Head Armor 2 sub Sensor 10 + Integral TarComp 2 end diff --git a/Design/BuruBuru.txt b/Design/BuruBuru.txt index 365076c..5c6ef8d 100644 --- a/Design/BuruBuru.txt +++ b/Design/BuruBuru.txt @@ -16,6 +16,7 @@ Mod Head Range 4 Acc 2 Speed 3 + Integral end Mod Body @@ -102,6 +103,7 @@ Mod Head Range 4 Acc 2 Speed 3 + Integral end Mod Body @@ -193,6 +195,7 @@ Mod Head Range 4 Acc 2 Speed 3 + Integral end Mod Body @@ -318,6 +321,7 @@ Mod Head Range 4 Acc 2 Speed 3 + Integral end Mod Body @@ -409,6 +413,7 @@ Mod Head Range 4 Acc 2 Speed 3 + Integral end Mod Body @@ -518,6 +523,7 @@ Mod Head Range 4 Acc 2 Speed 3 + Integral end Mod Body @@ -603,6 +609,7 @@ Mod Head Range 4 Acc 2 Speed 3 + Integral end Mod Body diff --git a/Design/Century.txt b/Design/Century.txt index c2aa4ed..f5930ca 100644 --- a/Design/Century.txt +++ b/Design/Century.txt @@ -12,6 +12,7 @@ Mod Head Name Range 3 Acc 1 + Integral Sensor 5 end @@ -37,6 +38,7 @@ Mod Arm Name Range 5 Speed 3 + Integral Magazine 20 sub Ammo 10 diff --git a/Design/Chimentero.txt b/Design/Chimentero.txt index 80b86da..e9bcaf4 100644 --- a/Design/Chimentero.txt +++ b/Design/Chimentero.txt @@ -93,6 +93,7 @@ Mod Body BeamGun 15 Name Range 14 + Integral Acc 1 Speed 1 @@ -233,5 +234,7 @@ Mod Tail Name Speed 3 Acc 2 + mass -8 + Integral end end diff --git a/Design/Claymore.txt b/Design/Claymore.txt index d6b81ee..9ef664e 100644 --- a/Design/Claymore.txt +++ b/Design/Claymore.txt @@ -6,6 +6,7 @@ Desc Size 7 Armor 5 + mass 1 sub MLauncher 4 Name @@ -86,6 +88,7 @@ Mod Leg Name Size 7 Armor 5 + mass 1 sub MLauncher 4 Name diff --git a/Design/Daum.txt b/Design/Daum.txt index ce33d2f..77e8a67 100644 --- a/Design/Daum.txt +++ b/Design/Daum.txt @@ -16,6 +16,7 @@ Mod Head Range 4 Acc 1 BV 6 + Integral end inv HeadArmor 2 diff --git a/Design/Daum2.txt b/Design/Daum2.txt index 82ac1a1..be8f199 100644 --- a/Design/Daum2.txt +++ b/Design/Daum2.txt @@ -18,6 +18,7 @@ Mod Head Range 3 Acc 1 BV 4 + Integral end inv HeadArmor 3 diff --git a/Design/Domino.txt b/Design/Domino.txt index 21f5e2c..4db111e 100644 --- a/Design/Domino.txt +++ b/Design/Domino.txt @@ -81,4 +81,6 @@ Mod Leg CyberSlot SkillModStealth SkillModAmount 3 + Integral + end diff --git a/Design/Excel.txt b/Design/Excel.txt index a436414..9210608 100644 --- a/Design/Excel.txt +++ b/Design/Excel.txt @@ -37,6 +37,7 @@ Mod Arm sub STC LAS-10 Range 6 + Integral end inv Shield 3 diff --git a/Design/Fenris.txt b/Design/Fenris.txt index ec6dd30..501acc6 100644 --- a/Design/Fenris.txt +++ b/Design/Fenris.txt @@ -14,10 +14,13 @@ Mod Head Sensor 3 - Melee 8 + Melee 9 Name + type Acc 1 Speed 1 + Integral + mass -4 end Mod Body @@ -48,10 +51,13 @@ Mod Leg STC MAC-4 end - Melee 4 + Melee 5 Acc 2 Speed 3 Name + mass -2 + Integral + end Mod Leg @@ -66,14 +72,18 @@ Mod Leg STC MAC-4 end - Melee 4 + Melee 5 Acc 2 Speed 3 Name + mass -2 + Integral + end Mod Tail Size 3 Armor 4 Mass -3 + Integral end diff --git a/Design/Gobuksan.txt b/Design/Gobuksan.txt index 868035e..fcee186 100644 --- a/Design/Gobuksan.txt +++ b/Design/Gobuksan.txt @@ -53,6 +53,7 @@ Mod Turret STC GR-24 Name Type + Integral end inv TurretArmor 5 diff --git a/Design/Luna2.txt b/Design/Luna2.txt index ea225ae..5580eaa 100644 --- a/Design/Luna2.txt +++ b/Design/Luna2.txt @@ -44,6 +44,12 @@ Mod Arm Range 8 Acc 3 end + + Melee 10 + name + type + mass -6 + Integral end Mod Arm @@ -67,6 +73,11 @@ Mod Arm Acc 2 Speed 5 end + Melee 10 + name + type + mass -6 + Integral end Mod Leg diff --git a/Design/Musketeer.txt b/Design/Musketeer.txt index f5eed75..8d87511 100644 --- a/Design/Musketeer.txt +++ b/Design/Musketeer.txt @@ -24,6 +24,7 @@ size 5 armor 3 sub STC LAS-10 + Integral end mod arm @@ -32,6 +33,7 @@ size 5 armor 3 sub STC LAS-10 + Integral end mod leg diff --git a/Design/Ovaknight.txt b/Design/Ovaknight.txt index 891a42f..70360c2 100644 --- a/Design/Ovaknight.txt +++ b/Design/Ovaknight.txt @@ -20,7 +20,7 @@ Mod Head end inv HeadArmor 5 - Mass -2 + Mass -7 end Mod Body @@ -37,6 +37,7 @@ Mod Body BeamGun 15 Name Type + Integral Acc 1 Speed 1 diff --git a/Design/Swan.txt b/Design/Swan.txt index 0423fc2..bfcc576 100644 --- a/Design/Swan.txt +++ b/Design/Swan.txt @@ -49,6 +49,7 @@ Mod Wing EMelee 4 Name Acc 2 + Integral Flight 4 end @@ -62,6 +63,7 @@ Mod Wing EMelee 4 Name Acc 2 + Integral Flight 4 end diff --git a/Design/Ultari.txt b/Design/Ultari.txt index 3114fcb..cf2b653 100644 --- a/Design/Ultari.txt +++ b/Design/Ultari.txt @@ -13,6 +13,7 @@ Mod Turret sub Ammo 9 end + Integral end Mod Body @@ -74,6 +75,7 @@ Mod Turret Type Speed 1 BV 4 + Integral end Mod Body @@ -139,6 +141,7 @@ Mod Turret Rockets 8 Type end + Integral end Mod Body diff --git a/Design/Vadel.txt b/Design/Vadel.txt index a26106e..b3b68bc 100644 --- a/Design/Vadel.txt +++ b/Design/Vadel.txt @@ -65,6 +65,7 @@ Mod Arm sub MLauncher 8 Name + Integral Magazine 5 sub Rockets 8 @@ -90,6 +91,7 @@ Mod Arm sub MLauncher 8 Name + Integral Magazine 5 sub Rockets 8 diff --git a/Design/Wolfram.txt b/Design/Wolfram.txt index 43da131..c6c89cd 100644 --- a/Design/Wolfram.txt +++ b/Design/Wolfram.txt @@ -7,16 +7,19 @@ Desc + mass 1 end Mod Body Armor 5 + mass 1 sub CPit @@ -31,12 +34,14 @@ Mod Body Range 4 Acc -1 Speed 1 + mass 1 end end Mod Arm Name Armor 4 + mass 1 sub Hand inv @@ -49,6 +54,7 @@ Mod Arm Mod Arm Name Armor 4 + mass 1 sub Hand end @@ -56,8 +62,10 @@ Mod Arm Mod Leg Name Armor 4 + mass 1 Mod Leg Name Armor 4 + mass 1 end diff --git a/GameData/ghpmacro.txt b/GameData/ghpmacro.txt index 6bacd96..df9b951 100644 --- a/GameData/ghpmacro.txt +++ b/GameData/ghpmacro.txt @@ -219,3 +219,10 @@ SkillModLeadership SkillModDominateAnimal SkillModPickPockets IsCharacter +Memo +Email +News +Phone +Sealed +Integral +Personadex diff --git a/GameData/messages.txt b/GameData/messages.txt index 1c21335..77a50b6 100644 --- a/GameData/messages.txt +++ b/GameData/messages.txt @@ -628,6 +628,13 @@ MEI_SkimThrust MEI_FlyThrust MEI_OverChargeBonus TRANSFER_GiveTo +INTRINSIC_1 +INTRINSIC_2 +INTRINSIC_3 +INTRINSIC_4 +INTRINSIC_5 +INTRINSIC_6 +INTRINSIC_7 GENDER_0 GENDER_1 GENDER_2 @@ -638,3 +645,4 @@ SELECTGENDER_NONBINARY + diff --git a/ability.pp b/ability.pp index 7d3b393..e7406c6 100644 --- a/ability.pp +++ b/ability.pp @@ -25,7 +25,7 @@ interface -uses gears,ghsensor; +uses gears,ghsensor,ghintrinsic; const XPA_AttackHit = 2; @@ -39,6 +39,13 @@ interface XPA_SK_Basic = 1; { XP for just using a combat skill. } XPA_SK_UseRepair = 3; + { PERSONAL COMMUNICATION CAPABILITIES } + PCC_Memo = GV_Memo; { Can view adventure memos } + PCC_EMail = GV_EMail; { Can receive emails from NPCs } + PCC_Comm = GV_Comm; { Can receive communications from NPCs } + PCC_Phone = GV_Comm; { Can receive communications from NPCs / legacy, same as above} + PCC_News = GV_News; { Can view internet global news } + CHAT_EXPERIENCE_TARGET = 20; REPAIR_CritFailure = -1; @@ -54,11 +61,6 @@ interface ); - { PERSONAL COMMUNICATION CAPABILITIES } - PCC_Memo = GV_Memo; { Can view adventure memos } - PCC_EMail = GV_EMail; { Can receive emails from NPCs } - PCC_Comm = GV_Comm; { Can receive communications from NPCs } - PCC_News = GV_News; { Can view internet global news } Direct_Skill_Learning: Boolean = False; @@ -97,6 +99,7 @@ procedure ResizeCharacter( PC: GearPtr ); Function MechaDescription( Mek: GearPtr ): String; Function HasPCommCapability( PC: GearPtr; C: Integer ): Boolean; Function HasTalent( PC: GearPtr; T: Integer ): Boolean; +Function HasIntrinsic( PC: GearPtr; I: Integer; CasualUse: Boolean ): Boolean; Function LancematePoints( PC: GearPtr ): Integer; @@ -871,6 +874,44 @@ procedure ExpandCharacter( PC: GearPtr ); HasTalent := ( PC <> Nil ) and ( NAttValue( PC^.NA , NAG_Talent , T ) <> 0 ); end; +Function HasIntrinsic( PC: GearPtr; I: Integer; CasualUse: Boolean ): Boolean; + { Return TRUE if the PC has the listed intrinsic, or FALSE otherwise. } + { If this is casual use, search the general inventory. Otherwise } + { just search the subcomponents. } + Function IntrinsicFoundAlongTrack( Part: GearPtr ): Boolean; + { Return TRUE if the intrinsic is found along this track. } + var + WasFound: Boolean; + begin + { Begin by assuming FALSE. } + WasFound := False; + + { Search along the track until we run out of parts or find } + { the intrinsic. } + while ( Part <> Nil ) and not WasFound do begin + if NotDestroyed( Part ) then begin + WasFound := NAttValue( Part^.NA , NAG_Intrinsic , I ) <> 0; + if not WasFound then WasFound := IntrinsicFoundAlongTrack( Part^.SubCom ); + if not WasFound then WasFound := IntrinsicFoundAlongTrack( Part^.InvCom ); + end; + Part := Part^.Next; + end; + + IntrinsicFoundAlongTrack := WasFound; + end; +var + it: Boolean; +begin + { Start with an error check- if this isn't a regular intrinsic, return FALSE. } + if ( PC = Nil ) or ( I < 1 ) or ( I > NumIntrinsic ) then Exit( False ); + + it := NAttValue( PC^.NA , NAG_Intrinsic , I ) <> 0; + if not it then it := IntrinsicFoundAlongTrack( PC^.SubCom ); + if CasualUse and not it then it := IntrinsicFoundAlongTrack( PC^.InvCom ); + HasIntrinsic := it; +end; + + Function LancematePoints( PC: GearPtr ): Integer; { Return however many lancemates the PC can have. } { A human lancemate who can pilot a mecha costs 2 points; a pet costs 1 point. } diff --git a/action.pp b/action.pp index 2fab85b..b68b048 100644 --- a/action.pp +++ b/action.pp @@ -59,7 +59,8 @@ procedure Crash( gb: GameBoardPtr; Mek: GearPtr ); implementation -uses ability,damage,gearutil,ghchars,ghmodule,ghweapon,interact,movement,rpgdice,texutil; +uses ability,damage,gearutil,ghchars,ghmodule,ghweapon,interact,movement,rpgdice,texutil, + ghintrinsic; const EjectDamage = 10; { The damage step to roll during an ejection attempt. } @@ -185,7 +186,7 @@ implementation TakeDamage( GB , Part , RollStep(EjectDamage) ); end; - if ERoll > EMod then begin + if ( ERoll > EMod ) and not PartHasIntrinsic( Part , NAS_Integral ) then begin { Delink the chaacter, then attach as a sibling of the master gear. } DelinkGear( Part^.Parent^.SubCom , Part ); Part^.Next := Master^.Next; diff --git a/backpack.pp b/backpack.pp index 6602ef5..ed2f3eb 100644 --- a/backpack.pp +++ b/backpack.pp @@ -71,11 +71,11 @@ implementation {$IFDEF SDLMODE} uses ability,action,arenacfe,arenascript,damage,gearutil,ghchars,ghholder, ghmodule,ghprop,ghswag,interact,menugear,rpgdice,skilluse,texutil, - sdlinfo,sdlmap,sdlmenus,ghweapon,colormenu,sdl; + sdlinfo,sdlmap,sdlmenus,ghweapon,ghintrinsic,colormenu,sdl; {$ELSE} uses ability,action,arenacfe,arenascript,damage,gearutil,ghchars,ghholder, ghmodule,ghprop,ghswag,interact,menugear,rpgdice,skilluse,texutil, - congfx,coninfo,conmap,conmenus,context,ghweapon; + congfx,coninfo,conmap,conmenus,context,ghweapon,ghintrinsic; {$ENDIF} var @@ -776,8 +776,11 @@ implementation CanBeExtracted := False; end else if ( Item^.G = GG_Module ) and ( Item^.S = GS_Body ) then begin CanBeExtracted := False; + end else if SeekGear( Item , GG_Cockpit , 0 , False ) <> Nil then begin + { If the item contains the cockpit, it can't be extracted. } + CanBeExtracted := False; end else begin - CanBeExtracted := True; + CanBeExtracted := Not PartHasIntrinsic( Item , NAS_Integral ); end; end; diff --git a/damage.pp b/damage.pp index 6038037..6da67f0 100644 --- a/damage.pp +++ b/damage.pp @@ -23,7 +23,7 @@ interface -uses gears; +uses gears,context,ghintrinsic; Const NAG_Damage = 12; @@ -1134,11 +1134,38 @@ implementation RepairFuelDescription := SkillMan[ Part^.S ].Name + ' ' + BStr( Part^.V ) + ' DP'; end; +Function IntrinsicsDescription( Part: GearPtr ): String; + { Return a list of all the intrinsics associated with this part. } +var + T: Integer; + it: String; +begin + it := ''; + + { Start by adding the armor type, if appropriate. FM:not yet backported} + {T := NAttValue( Part^.NA , NAG_GearOps , NAS_ArmorType ); + if T <> 0 then it := MsgString( 'ARMORTYPE_' + BStr( T ) );} + + { We're only interested if the intrinsics are attached directly } + { to this part. } + for t := 1 to NumIntrinsic do begin + if NAttValue( Part^.NA , NAG_Intrinsic , T ) <> 0 then begin + if it = '' then begin + it := MsgString( 'INTRINSIC_' + BStr( T ) ); + end else begin + it := it + ', ' + MsgString( 'INTRINSIC_' + BStr( T ) ); + end; + end; + end; + + IntrinsicsDescription := it; +end; + Function ExtendedDescription( Part: GearPtr ): String; { Provide an extended description telling all about the } { attributes of this particular item. } var - it: String; + it,IntDesc: String; SC: GearPtr; begin { Error check first. } @@ -1188,6 +1215,13 @@ implementation SC := SC^.Next; end; end; + + IntDesc := IntrinsicsDescription( Part ); + if IntDesc <> '' then begin + if it = '' then it := IntDesc + else it := it + ', ' + IntDesc; + end; + ExtendedDescription := it; end; diff --git a/effects.pp b/effects.pp index 5edf012..ef4244c 100644 --- a/effects.pp +++ b/effects.pp @@ -138,7 +138,8 @@ interface implementation uses ability,action,damage,gearutil,ghchars,ghmodule,ghguard,ghparser, - ghprop,ghsensor,ghsupport,ghweapon,movement,rpgdice,skilluse,texutil; + ghprop,ghsensor,ghsupport,ghweapon,movement,rpgdice,skilluse,texutil, + ghholder; Type AttackFlags = Record @@ -1092,12 +1093,79 @@ implementation AttemptDefenses := HiDefRoll; end; +Function Firing_Weight( Weapon: GearPtr; AtOp: Integer ): Integer; + { Return the firing weight of this weapon operating at the given AtOp. } +var + bfw: Integer; +begin + bfw := GearMass( Weapon ); + { Melee weapons count as larger than they actually are. } + if ( Weapon^.G = GG_Weapon ) and (( Weapon^.S = GS_Melee ) or ( Weapon^.S = GS_EMelee )) then begin + bfw := bfw * 2; + { Rapid fire also increases the firing weight. } + { Missile launchers don't get a penalty for burst firing; probably recoilless. } + end else if ( AtOp > 0 ) and not (( Weapon^.G = GG_Weapon ) and ( Weapon^.S = GS_Missile )) then begin + bfw := bfw + ( AtOp * 3 ) div 2; + end; + Firing_Weight := bfw; +end; + +Function Firing_Weight_Limit( User: GearPtr ): Integer; + { Return the maximum firing weight this user can handle. } +begin + if User^.G = GG_Mecha then begin + Firing_Weight_Limit := User^.V * 2 + 2; + end else if User^.G = GG_Character then begin + Firing_Weight_Limit := CStat( User , STAT_Body ); + end else begin + Firing_Weight_Limit := 100; + end; +end; Function CalcTotalModifiers( gb: GameBoardPtr; Attacker,Target: GearPtr; AtOp: Integer; AtAt: String ): Integer; { Calculate the total modifiers to this attack roll. } var SkRoll,Spd,ZA,ZT: Integer; AMaster,TMaster,AModule,AShield: GearPtr; + Function NotIntegralWeapon( Part: GearPtr ): Boolean; + { Return TRUE if part is an invcom or the descendant of an invcom. } + begin + NotIntegralWeapon := IsExternalPart( AMaster , Part ); + end; + Function WeaponWeightModifier: Integer; + { Return the targeting modifier caused by the weight of this weapon. } + Function HasFreeHand( LList: GearPtr ): Boolean; + { Return TRUE if you can find a hand of equal scale to AMaster } + { along this linked list, or FALSE otherwise. } + var + HandFound: Boolean; + begin + HandFound := False; + while ( LList <> Nil ) and ( not HandFound ) do begin + if ( LList^.G = GG_Holder ) and ( LList^.S = GS_Hand ) and ( LList^.Scale >= AMaster^.Scale ) and ( LList^.InvCom = Nil ) then begin + HandFound := True; + end else begin + HandFound := HasFreeHand( LList^.SubCom ); + end; + LList := LList^.Next; + end; + HasFreeHand := HandFound; + end; + var + W,L: Integer; + Weapon_Module: GearPtr; + begin + W := Firing_Weight( Attacker , AtOp ) * ( Attacker^.Scale + 1 ); + L := Firing_Weight_Limit( AMaster ) * ( AMaster^.Scale + 1 ); + Weapon_Module := FindModule( Attacker ); + if ( Weapon_Module <> Nil ) and ( Weapon_Module^.S = GS_Body ) then L := L * 2; + if HasFreeHand( AMaster^.SubCom ) then L := L * 3; + if W > L then begin + WeaponWeightModifier := -5 - ( ( W - L ) div ( AMaster^.Scale + 1 ) ) div 2; + end else begin + WeaponWeightModifier := 0; + end; + end; begin SkRoll := 0; AMaster := FindRoot( Attacker ); @@ -1135,6 +1203,11 @@ implementation SkRoll := SkRoll - 2; end; + { Modify the attack roll for overheavy weapons. } + if NotIntegralWeapon( Attacker ) then begin + SkRoll := SkRoll + WeaponWeightModifier; + end; + { Modify the attack roll for wielded shields. } AModule := FindModule( Attacker ); if AModule <> Nil then begin diff --git a/gearutil.pp b/gearutil.pp index 14ac13f..96606fb 100644 --- a/gearutil.pp +++ b/gearutil.pp @@ -86,11 +86,12 @@ function CStat( PC: GearPtr; Stat: Integer ): Integer; Procedure WriteCGears( var F: Text; G: GearPtr ); Function ReadCGears( var F: Text ): GearPtr; +Function IsExternalPart( Master,Part: GearPtr ): Boolean; implementation uses ghchars,ghcpit,ghguard,ghholder,ghmecha,ghmodule,ghmovers, - ghprop,ghsensor,ghsupport, + ghintrinsic,ghprop,ghsensor,ghsupport, ghswag,ghweapon,texutil; Const @@ -664,6 +665,10 @@ function InGoodModule( Part: GearPtr ): Boolean; GG_MoveSys: ComponentComplexity := Part^.V; else ComponentComplexity := 1; end; + + { If the part is integral, and not a module, reduce complexity by 1 } + { down to a minimum value of 1. } + if ( ComponentComplexity > 1 ) and ( Part^.G <> GG_Module ) and PartHasIntrinsic( Part , NAS_Integral ) then Dec( ComponentComplexity ); end; end; @@ -1322,6 +1327,9 @@ function InGoodModule( Part: GearPtr ): Boolean; for t := 1 to Part^.Scale do it := it * 5; end; + { Modify for intrinsics. } + it := it + IntrinsicCost( Part ); + { Modify for Fudge. } it := it + NAttValue( Part^.NA , NAG_GearOps , NAS_Fudge ); @@ -1836,4 +1844,18 @@ function CStat( PC: GearPtr; Stat: Integer ): Integer; end; +Function IsExternalPart( Master,Part: GearPtr ): Boolean; + { Return TRUE if Part is an invcom or a descendant of an invcom. } +var + IsXP: Boolean; +begin + { Assume FALSE until proven TRUE. } + IsXP := False; + while ( Part <> Nil ) and ( Part <> Master ) and not IsXP do begin + if IsInvCom( Part ) then IsXP := True; + Part := Part^.Parent; + end; + IsExternalPart := IsXP; +end; + end. diff --git a/ghintrinsic.pp b/ghintrinsic.pp new file mode 100644 index 0000000..164720a --- /dev/null +++ b/ghintrinsic.pp @@ -0,0 +1,85 @@ +unit ghintrinsic; + + { Intrinsics are flags that can be attached to any object. They increase } + { the cost of that object by a finite amount. } +{ + GearHead2, a roguelike mecha CRPG + Copyright (C) 2005 Joseph Hewitt + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or (at + your option) any later version. + + The full text of the LGPL can be found in license.txt. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser + General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +{$LONGSTRINGS ON} + +interface + +uses gears; + +const + NAG_Intrinsic = 18; + + NumIntrinsic = 7; + NAS_Memo = 1; + NAS_Email = 2; + NAS_News = 3; + NAS_Phone = 4; + NAS_EnviroSealed = 5; + NAS_Integral = 6; + NAS_Personadex = 7; + + Intrinsic_Value: Array [1..NumIntrinsic] of Integer = ( + 200, 300, 400, 500, 100, + 0, 250 + ); + + +Function IntrinsicCost( Item: GearPtr ): LongInt; +Function PartHasIntrinsic( Part: GearPtr; I: Integer ): Boolean; + +implementation + +Function IntrinsicCost( Item: GearPtr ): LongInt; + { Determine the cost of all the intrinsics attached to this item. } +var + Total: longInt; + I: NAttPtr; +begin + Total := 0; + I := Item^.NA; + while I <> Nil do begin + if ( I^.G = NAG_Intrinsic ) and ( I^.S >= 1 ) and ( I^.S <= NumIntrinsic ) then begin + total := total + Intrinsic_Value[ I^.S ]; + end; + I := I^.Next; + end; + IntrinsicCost := Total; +end; + +Function PartHasIntrinsic( Part: GearPtr; I: Integer ): Boolean; + { Return TRUE if Part has this intrinsic, or FALSE otherwise. } +begin + if Part = Nil then begin + PartHasIntrinsic := False; + {end else if Part^.G = GG_Software then begin + { Software that comes loaded with an intrinsic only functions } + { when it's been installed on a computer. } + PartHasIntrinsic := ( Part^.Parent <> Nil ) and ( Part^.Parent^.G = GG_Computer ) and ( NAttValue( Part^.NA , NAG_Intrinsic , I ) <> 0 );} + end else begin + PartHasIntrinsic := ( NAttValue( Part^.NA , NAG_Intrinsic , I ) <> 0 ); + end; +end; + +end. diff --git a/ghweapon.pp b/ghweapon.pp index e1b301d..b189394 100644 --- a/ghweapon.pp +++ b/ghweapon.pp @@ -314,7 +314,7 @@ interface implementation -uses texutil,gearutil,ghmodule; +uses texutil,gearutil,ghmodule,ghintrinsic; Function ScaleDC( DC,Scale: LongInt ): LongInt; { Take the basic, unscaled damage class DC and change it } @@ -619,7 +619,9 @@ implementation { Return TRUE if the provided EQUIP can be installed in WEP, } { FALSE if it can't be. } begin - if ( Wep^.S = GS_Ballistic ) or ( Wep^.S = GS_Missile ) then begin + if Equip^.G = GG_Weapon then begin + IsLegalWeaponSub := PartHasIntrinsic( Equip , NAS_Integral ); + end else if ( Wep^.S = GS_Ballistic ) or ( Wep^.S = GS_Missile ) then begin if NotGoodAmmo( Wep, Equip ) then IsLegalWeaponSub := False else if Equip^.Stat[ STAT_AmmoPresent ] > Wep^.Stat[ STAT_Magazine ] then IsLegalWeaponSub := False else IsLegalWeaponSub := True; diff --git a/pcaction.pp b/pcaction.pp index d9b0acd..f0d1379 100644 --- a/pcaction.pp +++ b/pcaction.pp @@ -648,6 +648,12 @@ implementation Procedure MemoBrowser( GB: GameBoardPtr; PC: GearPtr ); { Find all the memos that the player has accumulated, then allow } { them to be browsed through, then restore the display afterwards. } +const + m_email = 1; + m_memo = 2; + m_rumor = 3; + m_news = 4; + m_Personadex = 5; var MainMenu: RPGMenuPtr; CRating,A: Integer; @@ -775,7 +781,7 @@ implementation Name: String; NPC: GearPtr; begin - if HasPCommCapability( PC , PCC_Comm ) then begin + if HasPCommCapability( PC , PCC_Phone ) then begin DialogMsg( MsgString( 'PHONE_Prompt' ) ); {$IFDEF SDLMODE} Name := GetStringFromUser( MsgString( 'PHONE_GetName' ) , @PhoneRedraw );