예제 #1
0
 public static HitEffectMap.Entry GetEntry(HitEffectMap.HitEffectEvent enEvent, HitEffectMap.Modifier enModifier)
 {
     if (!HitEffectMap.SuperDictionaryOfDeath.ContainsKey(enEvent))
     {
         return null;
     }
     if (!HitEffectMap.SuperDictionaryOfDeath[enEvent].ContainsKey(enModifier))
     {
         return HitEffectMap.SuperDictionaryOfDeath[enEvent][HitEffectMap.Modifier.Default];
     }
     return HitEffectMap.SuperDictionaryOfDeath[enEvent][enModifier];
 }
예제 #2
0
 public void CreateHitEffect(HitEffectMap.HitEffectEvent enEvent, HitEffectMap.Modifier enModifier, Vector2 v2PointOfImpact, IEntity xThingHit)
 {
     HitEffectMap.Entry xEntry = HitEffectMap.GetEntry(enEvent, enModifier);
     SortedAnimated.SortedAnimatedEffects eff = xEntry.enEffect;
     SortedAnimated kaktus = Program.GetTheGame()._EffectMaster_AddEffect(new SortedAnimated(v2PointOfImpact, eff)) as SortedAnimated;
     if ((xEntry.enSpecialFlags & HitEffectMap.Entry.SpecialFlags.Follow) == HitEffectMap.Entry.SpecialFlags.Follow)
     {
         kaktus.xRenderComponent.xTransform = xThingHit.xTransform;
         kaktus.xRenderComponent.v2OffsetRenderPos = v2PointOfImpact - kaktus.xRenderComponent.xTransform.v2Pos;
     }
     if ((xEntry.enSpecialFlags & HitEffectMap.Entry.SpecialFlags.RotateTowards) == HitEffectMap.Entry.SpecialFlags.RotateTowards)
     {
         Vector2 v2Dir = v2PointOfImpact - this.xTransform.v2Pos;
         v2Dir.Normalize();
         float fRadians = (float)Math.Atan2((double)v2Dir.Y, (double)v2Dir.X) + 1.57079637f;
         kaktus.xRenderComponent.fRotation += fRadians;
     }
     kaktus.xRenderComponent.fVirtualHeight += this.xRenderComponent.fVirtualHeight;
     if (Program.GetTheGame().xNetworkInfo.enCurrentRole == NetworkHelperInterface.NetworkRole.Server)
     {
         Game1 master = Program.GetTheGame();
         if (xThingHit.enEntityType == IEntity.EntityType.Enemy)
         {
             Enemy boeg = xThingHit as Enemy;
             foreach (PlayerView xOtherView in master.dixPlayers.Values)
             {
                 if (xOtherView != master.xLocalPlayer)
                 {
                     NetOutgoingMessage om = master.xNetworkInfo.server.CreateMessage();
                     om.Write(54);
                     om.Write(this.Owner.iConnectionIdentifier);
                     om.Write(boeg.iID);
                     om.Write((byte)enEvent);
                     om.Write((byte)enModifier);
                     om.Write((ushort)v2PointOfImpact.X);
                     om.Write((ushort)v2PointOfImpact.Y);
                     master.xNetworkInfo.server.SendMessage(om, xOtherView.netConnection, NetDeliveryMethod.ReliableUnordered);
                 }
             }
         }
     }
 }
예제 #3
0
 public Entry(SortedAnimated.SortedAnimatedEffects enEffect, HitEffectMap.Entry.SpecialFlags enSpecialFlags)
 {
     this.enEffect = enEffect;
     this.enSpecialFlags = enSpecialFlags;
 }
예제 #4
0
 public Entry(SortedAnimated.SortedAnimatedEffects enEffect, HitEffectMap.Entry.SpecialFlags enSpecialFlags, HitEffectMap.Entry.Direction enDirection)
 {
     this.enEffect = enEffect;
     this.enSpecialFlags = enSpecialFlags;
     this.enDirection = enDirection;
 }