// fuck you, alwaysloaded... class mcu8_NPC_Mobster extends Hat_NPC placeable; var Hat_RollingBarrel Barrel; var bool ToggleBarrel; var transient Array DefaultAnimSets; defaultproperties { Begin Object Name=SkeletalMeshComponent0 PhysicsAsset=PhysicsAsset'HatInTime_Characters.Physics.MafiaGreg_Physics' SkeletalMesh=SkeletalMesh'HatInTime_Characters.models.MafiaGreg' AnimTreeTemplate=AnimTree'HatInTime_Characters.AnimTree.MafiaGreg_animtree' Animations = None; AnimSets(0)=AnimSet'HatInTime_Characters.AnimSet.MafiaGreg_Anims' AnimSets(1)=AnimSet'HatinTime_Characters_Mafia.AnimSets.MafiaGreg_Anims_Cameron' `if(`notdefined(IS_NINTENDO_SWITCH)) bHasPhysicsAssetInstance = TRUE; `endif BlockActors=false BlockZeroExtent=false BlockNonZeroExtent=false CollideActors=false BlockRigidBody=false Translation=(Z=-60) End Object Begin Object Class=CylinderComponent Name=CollisionCylinder CollisionRadius=40 CollisionHeight=60 CanBlockCamera = false BlockActors=true BlockZeroExtent=true BlockNonZeroExtent=true CollideActors=true BlockRigidBody=true End Object CollisionComponent=CollisionCylinder Components.Add(CollisionCylinder) Begin Object Class=Hat_ExpressionComponent_Mafia Name=hExpression End Object Components.Add(hExpression); Expression = hExpression; } function OnSpawnBarrel(Hat_SeqAct_SpawnBarrel s) { local Hat_RollingBarrel b; if (s.InputLinks[0].bHasImpulse) { ThrowBarrel(); } else if (s.InputLinks[1].bHasImpulse) { b = Spawn(s.BarrelClass, self, , self.Location + vect(0,0,1)*200); b.BounceLimit = 2; Barrel = b; } else if (s.InputLinks[2].bHasImpulse) { b = Spawn(s.BarrelClass, self, , self.Location + vect(0,0,1)*200); b.BounceLimit = 8; b.Path2DOnBounce = true; b.MoveClockwise = ToggleBarrel; //b.Set2D(s.Path2D); b.MakeRadial(450, Location); Barrel = b; b.BounceHeight = 750; b.BounceMoveSpeed = 400; ToggleBarrel = !ToggleBarrel; } else if (s.InputLinks[3].bHasImpulse) { b = Spawn(s.BarrelClass, self, , self.Location + vect(0,0,1)*200); b.BounceLimit = 10; b.Path2DOnBounce = true; b.MoveClockwise = ToggleBarrel; //b.Set2D(s.Path2D); b.MakeRadial(450, Location); b.BounceHeight = 750; Barrel = b; ToggleBarrel = !ToggleBarrel; } if (b != None) { b.StartVelocity.Z =400; b.LifeSpan = 20; b.SetEnabled(false); b.SetBase(self, , SkeletalMeshComponent, 'Barrel'); } } function ThrowBarrel() { if (Barrel == None) return; Barrel.SetBase(None); Barrel.SetRotation(Rotation); Barrel.SetEnabled(true); Barrel = None; } simulated event bool RestoreAnimSetsToDefault() { SkeletalMeshComponent.AnimSets = DefaultAnimSets; return TRUE; } simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp) { Super.PostInitAnimTree(SkelComp); // Only refresh anim nodes if our main mesh was updated if (SkelComp == SkeletalMeshComponent) { DefaultAnimSets = SkelComp.AnimSets; } }