Пример #1
0
 private void Awake()
 {
     if (!cubeEffectController)
     {
         cubeEffectController = GetComponentInChildren <BlockEffect>();
     }
 }
Пример #2
0
        private bool SendChar(GameObject droppedChar, BlockType blockType)
        {
            CharInListView charView    = droppedChar.GetComponent <CharInListView>();
            BlockEffect    blockEffect = new BlockEffect()
            {
                BlockType = blockType
            };
            bool succes = true;

            if (blockType == BlockType.Reactor)
            {
                droppedChar.GetComponent <Dragable>().StopDrag();
                pool.Remove(charView.CharModel);
                blockEffect.Status = statsMath.GetBurningEnergy(charView.CharModel);
                Debug.Log(statsMath.GetBurningEnergy(charView.CharModel));
                blockEffect.PeopleCount = 1;
                shipController.ApplyBlockEffect(blockEffect);
            }
            else
            {
                blockEffect.PeopleCount = 1;
                succes = shipController.ApplyBlockEffect(blockEffect);

                if (succes)
                {
                    charView.CharModel.Location = blockType;
                    charView.UpdateDescription();
                }
            }

            return(succes);
        }
Пример #3
0
    public override void ExecuteEffect(Battlefield obf, Battlefield abf, ref int targetIndex, GameObject specialVFX)
    {
        int toBeFreezedIndex;

        if (BlockEffect.IsThereABlockerInTheFrontOfTarget(obf, targetIndex))
        {
            toBeFreezedIndex = obf.GetIndexInFrontOf(targetIndex);
        }
        else
        {
            toBeFreezedIndex = targetIndex;
        }

        obf.GetReferenceToCardAt(toBeFreezedIndex).ApplyFreezing(Instantiate(specialVFX));
    }
Пример #4
0
        public bool ApplyBlockEffect(BlockEffect effect)
        {
            Block block = spaceShip.GetBlockModel(effect.BlockType);

            block.Capacity += effect.Capacity;
            bool success = block.AddPeople(effect.PeopleCount);

            if (success)
            {
                block.AddToStatus(effect.Status);
                block.MaxSpending    += effect.MaxSpending;
                block.ActualSpending += effect.ActualSpending;
            }
            else
            {
                block.Capacity -= effect.Capacity;
            }

            return(success);
        }
Пример #5
0
    public override void ExecuteEffect(Battlefield obf, Battlefield abf, ref int targetIndex, GameObject specialVFX)
    {
        Card attacker = abf.GetSelectedCard();
        Card target;

        if (BlockEffect.IsThereABlockerInTheFrontOfTarget(obf, targetIndex))
        {
            target = obf.GetCardInFrontOf(targetIndex);
        }
        else
        {
            target = obf.GetReferenceToCardAt(targetIndex);
        }
        attacker.Skill = target.Skill;
        target.Skill   = skillsMediator.GetBasicAttackSkill();

        if (skillsMediator.IsTheSkillNamedStrong(attacker.Skill))
        {
            attacker.ModifyAttackPowerForThisMatch(valueToSum: +4 + target.GetLevel() * 4);
            target.ModifyAttackPowerForThisMatch(valueToSum: -4 - target.GetLevel() * 4);
        }
    }
Пример #6
0
    public void EndSecondary()
    {
        if (!canUse)
        {
            return;
        }

        if (useState == PhysicalWeaponUseState.Blocking)
        {
            if (OnEndSecondary != null)
            {
                OnEndSecondary(this, new EventArgs());
            }

            useState = PhysicalWeaponUseState.Default;

            EffectManager manager = GetComponentInParent <EffectManager>();
            if (manager != null && blockEffect != null)
            {
                manager.RemoveEffect(blockEffect);
                blockEffect = null;
            }
        }
    }
Пример #7
0
    public void Secondary()
    {
        if (!canUse)
        {
            return;
        }

        if (useState == PhysicalWeaponUseState.Default)
        {
            if (OnSecondary != null)
            {
                OnSecondary(this, new EventArgs());
            }

            useState = PhysicalWeaponUseState.Blocking;

            EffectManager manager = GetComponentInParent <EffectManager>();
            if (manager != null)
            {
                blockEffect = new BlockEffect(minBlockValue, maxBlockValue);
                manager.AddEffect(blockEffect);
            }
        }
    }
Пример #8
0
        public RenderingShaders(GraphicsDevice device)
        {
            var fogStart = 0f;

            TransparentEffect = new BlockEffect()
            {
                //	Texture = stillAtlas,
                VertexColorEnabled = true,
                World          = Matrix.Identity,
                AlphaFunction  = CompareFunction.Greater,
                ReferenceAlpha = 32,
                FogStart       = fogStart,
                FogEnabled     = false,
                // TextureEnabled = true
            };

            TranslucentEffect = new BlockEffect()
            {
                //Texture = stillAtlas,
                VertexColorEnabled = true,
                World          = Matrix.Identity,
                AlphaFunction  = CompareFunction.Greater,
                ReferenceAlpha = 32,
                FogStart       = fogStart,
                FogEnabled     = false,

                //Alpha = 0.5f
            };

            AnimatedEffect = new BlockEffect()
            {
                //	Texture = Resources.Atlas.GetAtlas(0),
                VertexColorEnabled = true,
                World          = Matrix.Identity,
                AlphaFunction  = CompareFunction.Greater,
                ReferenceAlpha = 32,
                FogStart       = fogStart,
                FogEnabled     = false,
                // TextureEnabled = true
            };

            AnimatedTranslucentEffect = new BlockEffect()
            {
                //Texture = Resources.Atlas.GetAtlas(0),
                VertexColorEnabled = true,
                World          = Matrix.Identity,
                AlphaFunction  = CompareFunction.Greater,
                ReferenceAlpha = 127,
                FogStart       = fogStart,
                FogEnabled     = false,
                Alpha          = 0.5f
            };

            OpaqueEffect = new BlockEffect()
            {
                //  TextureEnabled = true,
                //	Texture = stillAtlas,
                FogStart           = fogStart,
                VertexColorEnabled = true,
                //  LightingEnabled = true,
                FogEnabled     = false,
                ReferenceAlpha = 249,
                AlphaFunction  = CompareFunction.Always
                                 //    AlphaFunction = CompareFunction.Greater,
                                 //    ReferenceAlpha = 127

                                 //  PreferPerPixelLighting = false
            };

            LightingEffect = new LightingEffect(device)
            {
            };
        }