Skip to content
This repository has been archived by the owner on Jun 12, 2019. It is now read-only.

Commit

Permalink
Added monster summoning totems. Totem summons and picked up companion…
Browse files Browse the repository at this point in the history
…s are now affected by monster buffing abilties.

Signed-off-by: Patrick Dinklage <pdinklag@googlemail.com>
  • Loading branch information
pdinklag committed Oct 11, 2013
1 parent 7852f45 commit d0d946a
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Classes/FX_SummonBeam.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class FX_SummonBeam extends FX_Beam;

defaultproperties {
Skins(0)=FinalBlend'XEffectMat.LinkBeamRedFB'
LifeSpan=1.5
LightHue=0
}
12 changes: 11 additions & 1 deletion Classes/FriendlyMonsterPickup.uc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ auto state Pickup {
local Monster M;
local FriendlyMonsterController C;
local class<Monster> Type;
local int Tries;
local int Tries, i;
local RPGPlayerReplicationInfo RPRI;

if(ValidTouch(Other) && PossibleTypes.Length > 0) {
P = Pawn(Other);
Expand All @@ -37,6 +38,15 @@ auto state Pickup {
C = Spawn(class'FriendlyMonsterController',,, M.Location, M.Rotation);
C.Possess(M);
C.SetMaster(P.Controller);

RPRI = class'RPGPlayerReplicationInfo'.static.GetFor(P.Controller);
if(RPRI != None) {
for(i = 0; i < RPRI.Abilities.Length; i++) {
if(RPRI.Abilities[i].bAllowed)
RPRI.Abilities[i].ModifyMonster(M, P);
}
}

break;
}
}
Expand Down
8 changes: 8 additions & 0 deletions Classes/TotemIcon_MonsterSummon.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class TotemIcon_MonsterSummon extends RPGTotemIcon;

defaultproperties {
StaticMesh=StaticMesh'Editor.TexPropSphere'
Physics=PHYS_None
Skins(0)=TexEnvMap'wm_textures.Effects.wm_EnvMap1'
DrawScale=0.17
}
66 changes: 66 additions & 0 deletions Classes/Totem_MonsterSummon.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
class Totem_MonsterSummon extends RPGTotem CacheExempt;

var config float InitialDelay, Interval;
var config array<class<Monster> > MonsterTypes;

auto state Active {
event BeginState() {
SetTimer(InitialDelay, false);
}

function Timer() {
local class<Monster> Type;
local vector Off;
local int Tries, i;
local Monster M;
local Controller Master;
local FriendlyMonsterController C;
local FX_SummonBeam Beam;
local RPGPlayerReplicationInfo RPRI;

Master = RPGTotemController(Controller).Master;
if(Master != None && Master.Pawn != None && MonsterTypes.Length > 0) {
Type = MonsterTypes[Rand(MonsterTypes.Length)];

while(M == None && Tries < 25) {
Tries++;

Off = VRand() * 2.5 * (CollisionRadius * DrawScale + Type.default.CollisionRadius * Type.default.DrawScale);
Off.Z = 32;

M = Master.Pawn.Spawn(Type, Master,, Location + Off, rotator(Off));
if(M != None) {
if(M.Controller != None)
M.Controller.Destroy();

C = Spawn(class'FriendlyMonsterController',,, M.Location, M.Rotation);
C.Possess(M);
C.SetMaster(Master);

RPRI = class'RPGPlayerReplicationInfo'.static.GetFor(Master);
if(RPRI != None) {
for(i = 0; i < RPRI.Abilities.Length; i++) {
if(RPRI.Abilities[i].bAllowed)
RPRI.Abilities[i].ModifyMonster(M, Master.Pawn);
}
}

Beam = Instigator.Spawn(class'FX_SummonBeam', Icon);
Beam.LinkedPawn = M;
break;
}
}
}

SetTimer(Interval, true);
}
}

defaultproperties {
InitialDelay=5.0
Interval=45.0
MonsterTypes(0)=class'SkaarjPack.Krall'

IconClass=class'TotemIcon_MonsterSummon'
VehicleNameString="Summoning Totem"
}
11 changes: 9 additions & 2 deletions TitanRPG.ini
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,9 @@ AvailablePickups=(PickupClass=Class'TitanRPG.ArtifactPickup_PoisonBlast',Chance=
AvailablePickups=(PickupClass=Class'TitanRPG.ArtifactPickup_FreezeBomb',Chance=1)
AvailablePickups=(PickupClass=Class'TitanRPG.ArtifactPickup_BioBomb',Chance=1)
AvailablePickups=(PickupClass=Class'TitanRPG.ArtifactPickup_TripleDamage',Chance=1)
PickupStatic=StaticMesh'TitanRPG.EasterEgg.EggStatic'
PickupDrawScale=0.1
AvailablePickups=(PickupClass=Class'TitanRPG.FriendlyMonsterPickup',Chance=1)
;PickupStatic=StaticMesh'TitanRPG.EasterEgg.EggStatic'
;PickupDrawScale=0.1
MaxAdrenalinePickups=15
AdreanlineSpawnAmount=5

Expand Down Expand Up @@ -877,6 +878,7 @@ MaxLevel=3
TotemTypes=(Level=1,TotemClass=class'TitanRPG.Totem_Heal',Cost=0,Cooldown=20)
TotemTypes=(Level=1,TotemClass=class'TitanRPG.Totem_Repair',Cost=0,Cooldown=20)
TotemTypes=(Level=2,TotemClass=class'TitanRPG.Totem_Lightning',Cost=0,Cooldown=20)
TotemTypes=(Level=2,TotemClass=class'TitanRPG.Totem_MonsterSummon',Cost=0,Cooldown=20)

[TitanRPG.Ability_TransAmmo]
BonusPerLevel=1
Expand Down Expand Up @@ -1239,6 +1241,11 @@ HealAmount=10
Interval=3.0
Damage=25

[TitanRPG.Totem_MonsterSummon]
InitialDelay=5.0
Interval=45.0
MonsterTypes=Class'SkaarjPack.Krall'

[TitanRPG.Totem_Repair]
Interval=1.0
RepairAmount=25
Expand Down

0 comments on commit d0d946a

Please sign in to comment.