Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //1.1
- class AbilityCraftAutoTurret extends RPGAbility
- abstract;
- static simulated function int Cost(RPGPlayerDataObject Data, int CurrentLevel)
- {
- if (Data.Abilities.length > 0 && class<AbilityClassMechanic>(Data.Abilities[0]) != None)
- return Super(RPGAbility).Cost(Data, CurrentLevel);
- Return 0;
- }
- static function ModifyPawn(Pawn Other, int AbilityLevel)
- {
- local ArtifactCraftAutoTurret Artifact;
- local RPGStatsInv StatsInv;
- local InvScrapMetal InvMetal;
- local Inventory Inv;
- local int Count;
- if (Other.Role < ROLE_Authority)
- return;
- if(Monster(Other) != None)
- return;
- InvMetal = InvScrapMetal(Other.FindInventoryType(class'InvScrapMetal'));
- if (InvMetal == None)
- return; //this should not happen if you are a mechanic
- StatsInv = RPGStatsInv(Other.FindInventoryType(class'RPGStatsInv'));
- for( Inv=Other.Inventory; Inv!=None && Count < 1000; Inv=Inv.Inventory ) // Artifact = ...
- {
- if ( Inv.class == class'ArtifactCraftAutoTurret' )
- {
- Artifact = ArtifactCraftAutoTurret(Inv);
- break;
- }
- Count++;
- }
- if (Artifact != None)
- {
- if (Artifact.AbilityLevel == AbilityLevel)
- return;
- }
- else
- {
- Artifact = Other.spawn(class'ArtifactCraftAutoTurret', Other,,, rot(0,0,0));
- if (Artifact != None)
- {
- Artifact.giveTo(Other);
- Other.NextItem();
- }
- }
- if (Artifact != None)
- {
- Artifact.AbilityLevel = AbilityLevel;
- Artifact.InvMetal = InvMetal;
- if (StatsInv != None)
- Artifact.AmmoBonus = StatsInv.DataObject.AmmoMax;
- }
- }
- defaultproperties
- {
- AbilityName="Craft Auto Turret"
- Description="Using spare parts of any metal, the mechanic is able to generate auto turret.|Mana cost (per level): 40, 30, 20, 10|Turrets generated: 1|Metal cost: 1|Max level: 4"
- StartingCost=4
- CostAddPerLevel=-1
- BotChance=0
- MaxLevel=4
- PackageName="SillyRPG"
- ClassFilterName="Mechanic Class"
- RequiredRanking(0)=1
- RequiredRanking(1)=1
- RequiredRanking(2)=2
- RequiredRanking(3)=2
- bGivesArtifact=True
- }
Advertisement
Add Comment
Please, Sign In to add comment