private TimeEffect EfffectOn(int time)
    {
        GameObject immortalityEffect = (GameObject)Resources.Load( "Prefabs/Particles/Immortality" );

        if ( time == 1 ) {
            immortalityEffect = null;
        }

        EffectsController effectsController = new EffectsController();

        TimeEffect effect = new TimeEffect( effectsController );
        effect.id = 99;
        effect.name = "Immortality";
        effect.visualPrefab = immortalityEffect;
        effect.duration = time;

        effect.characteristicsModifiers.armor = 1;
        effect.characteristicsModifiers.attack = 1;
        effect.characteristicsModifiers.attackRange = 1;
        effect.characteristicsModifiers.attackSpeed = 1;
        effect.characteristicsModifiers.speed = 1;
        effect.characteristicsModifiers.armor = 1;
        effect.characteristicsModifiers.hp = 1;

        return effect;
    }
 public PathPreviewVisual(Path newPath, Path actualPath, NoneHandler hideCompletedCallback)
 {
     NewPath = newPath;
     ActualPath = actualPath;
     HideCompletedCallback = hideCompletedCallback;
     EffectsController = new EffectsController<IVisual>();
     State = PPVState.HidingEnded;
 }
 public int InvokeBuf( EffectsController.RemoveCoroutineEffect  removeEffect, TimeEffect timeEffect )
 {
     ++counter;
     IEnumerator tempIEnumerator = _InvokeBuf( removeEffect, timeEffect );
     currentCoroutines.Add( counter, tempIEnumerator );
     StartCoroutine( tempIEnumerator );
     return counter;
 }
Beispiel #4
0
    void Awake()
    {
        // Register the singleton
        if (Instance != null)
        {
            Debug.LogError("Multiple instances of EffectsController!");
        }

        Instance = this;
    }
 public void SFEXT_L_ECStart()
 {
     localPlayer      = Networking.LocalPlayer;
     HUDControl       = EngineControl.HUDControl;
     EffectsControl   = EngineControl.EffectsControl;
     VehicleTransform = EngineControl.VehicleMainObj.GetComponent <Transform>();
     Dial_FunconNULL  = Dial_Funcon == null;
     if (!Dial_FunconNULL)
     {
         Dial_Funcon.SetActive(EffectsControl.CanopyOpen);
     }
 }
Beispiel #6
0
    public override void onDeath()
    {
        Player owner = self.Player;
        Player enemy = CardController.getController().getOtherPlayer(self.Player);

        if (enemy.board.Count > 0)
        {
            int    choice = Random.Range(0, enemy.board.Count);
            Minion picked = enemy.board[choice];
            EffectsController.takeControlOfMinion(picked, owner, enemy);
        }
    }
Beispiel #7
0
        protected ConversationNodeDataControl(ConversationDataControl conversation, ConversationNode conversationNode)
        {
            this.conversation      = conversation;
            this.conversationNode  = conversationNode;
            this.effectsController = new EffectsController(conversationNode.getEffects());

            conversationLines = new List <ConversationLineDataControl>();
            for (int i = 0; i < conversationNode.getLineCount(); i++)
            {
                conversationLines.Add(new ConversationLineDataControl(conversationNode.getLine(i)));
            }
        }
    public override bool getBattlecryTarget()
    {
        if (EffectsController.getAllMinions().Count > 0)

        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
        public override bool isValid(string currentPath, List <string> incidences)
        {
            bool valid = true;

            // Valid if the effects and the post effects are valid
            valid &= EffectsController.isValid(currentPath + " >> " + TC.get("Element.Effects"), incidences,
                                               timer.getEffects());
            valid &= EffectsController.isValid(currentPath + " >> " + TC.get("Element.PostEffects"), incidences,
                                               timer.getPostEffects());

            return(valid);
        }
        /**
         * Constructor.
         *
         * @param sceneDataControl
         *            Parent scene controller
         * @param exit
         *            Exit of the data control structure
         */
        public ExitDataControl(SceneDataControl sceneDataControl, Exit exit)
        {
            this.sceneDataControl = sceneDataControl;
            this.exit             = exit;

            this.influenceAreaDataControl = new InfluenceAreaDataControl(sceneDataControl, exit.getInfluenceArea(), this);
            effectsController             = new EffectsController(exit.getEffects());
            postEffectsController         = new EffectsController(exit.getPostEffects());
            notEffectsController          = new EffectsController(exit.getNotEffects());
            conditionsController          = new ConditionsController(new Conditions());
            exitLookDataControl           = new ExitLookDataControl(exit);
        }
Beispiel #11
0
    public void GetHit(Vector2 hitDir, float power, Character attacker)
    {
        hitsTaken++;
        print("hit power: " + power);
        if (IngestedFly)
        {
            IngestedFly = false;
            ingestingFly.transform.position = Center;
            ingestingFly.BeingIngested      = false;
            ingestingFly.gameObject.SetActive(true);
        }
        if (ingestingFly != null)
        {
            ingestingFly.BeingIngested = false;
            ingestingFly = null;
        }
        if (hitDir.y < -0.1f)
        {
            wasHitDownwards = true;
        }
        hasReachedApex   = false;
        lastHitByPlayer  = attacker.player;
        canBounceDodge   = false;
        hasBounceDodged  = false;
        canBounceTongue  = false;
        hasBounceTongued = false;
        state            = CharacterState.Bouncing;
        attackState      = AttackState.Idle;
        if (hitDir.y == 0)
        {
            hitDir.y = 0.33f;
        }
        hitDir.Normalize();
        float totalPower = 10f + hitsTaken * 10f + power * 30f;

        skidRecoverTimeLeft = 0.5f;
        velocity            = hitDir.normalized * totalPower;
        timeSinceHit        = 0f;

        TimeBump(hitsTaken + power, 0f);
        attacker.TimeBump(hitsTaken + power, 0f);
        //EffectsController.CreateHitParticles(transform.position + Vector3.up * height * 0.5f, hitDir, totalPower,(int) (totalPower / 5f));
        SoundController.PlaySoundEffect("BatHit" + Mathf.Clamp(hitsTaken, 1, 5).ToString(), 0.5f, transform.position);
        SoundController.PlaySoundEffect("BatHitVoice" + Mathf.Clamp(hitsTaken, 1, 5).ToString(), 0.5f, transform.position);
        TimeController.TimeBumpCharacters(transform.position, hitsTaken + power, 15f, true);
        EffectsController.CreateLocalizedShake(transform.position + Vector3.up * height * 0.5f, velocity, velocity.magnitude, timeBumpTimeLeft);
        EffectsController.CreateHitEffect(transform.position + Vector3.up * height * 0.5f, timeBumpTimeLeft, power >= 1f);
        if (power >= 1f)
        {
            EffectsController.ShakeCamera(hitDir, hitsTaken * 0.75f);
        }
    }
Beispiel #12
0
    public override void onPlay()
    {
        int count = 0;

        foreach (BoardCharacter c in EffectsController.getAllCharacters(caster))
        {
            if (c.cHealth < c.bHealth)
            {
                count++;
            }
        }
        caster.draw(count);
    }
        private void button10_Click(object sender, EventArgs e)
        {
            ColorDialog MyDialog = new ColorDialog();

            MyDialog.AllowFullOpen = true;
            MyDialog.ShowHelp      = true;
            MyDialog.Color         = Color.Black;
            if (MyDialog.ShowDialog() == DialogResult.OK)
            {
                Color temp = MyDialog.Color;
                EffectsController.SetColor(3, temp);
            }
        }
    public override bool getBattlecryTarget()
    {
        List <Minion> allMinions   = EffectsController.getAllMinions();
        List <Minion> validTargets = new List <Minion>();

        foreach (Minion m in allMinions)
        {
            if (m.cAttack >= 7)
            {
                return(true);
            }
        }
        return(false);
    }
        public override int countAssetReferences(string assetPath)
        {
            int count = 0;

            // Iterate through the resources
            foreach (ResourcesDataControl resourcesDataControl in resourcesDataControlList)
            {
                count += resourcesDataControl.countAssetReferences(assetPath);
            }

            count += EffectsController.countAssetReferences(assetPath, cutscene.getEffects());

            return(count);
        }
        /**
         * Contructor.
         *
         * @param action
         *            Next scenes of the data control structure
         *
         *
         */
        public ActionDataControl(Action action, string name)
        {
            this.action = action;

            this.resourcesList            = new List <ResourcesUni>();
            this.resourcesDataControlList = new List <ResourcesDataControl>();

            actionType = Controller.ACTION_TALK_TO;

            // Create subcontrollers
            conditionsController = new ConditionsController(action.getConditions(), actionType, name);
            effectsController    = new EffectsController(action.getEffects());
            notEffectsController = new EffectsController(action.getNotEffects());
        }
 public override void deleteAssetReferences(string assetPath)
 {
     if (action.getType() == Action.CUSTOM_INTERACT || action.getType() == Action.CUSTOM)
     {
         // Iterate through the resources
         foreach (ResourcesDataControl resourcesDataControl in resourcesDataControlList)
         {
             resourcesDataControl.deleteAssetReferences(assetPath);
         }
     }
     EffectsController.deleteAssetReferences(assetPath, action.getEffects());
     EffectsController.deleteAssetReferences(assetPath, action.getNotEffects());
     // EffectsController.deleteAssetReferences( assetPath, action.getClickEffects( ) );
 }
Beispiel #18
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     musicController   = GetComponent <MusicController>();
     effectsController = GetComponent <EffectsController>();
 }
        public override int countIdentifierReferences(string id)
        {
            int count = 0;

            if (id.Equals(exit.getNextSceneId()))
            {
                count = 1;
            }
            count += EffectsController.countIdentifierReferences(id, exit.getEffects());
            count += EffectsController.countIdentifierReferences(id, exit.getPostEffects());
            count += EffectsController.countIdentifierReferences(id, exit.getNotEffects());
            count += conditionsController.countIdentifierReferences(id);
            return(count);
        }
        public override bool isValid(string currentPath, List <string> incidences)
        {
            bool valid = true;

            // Iterate through the resources
            for (int i = 0; i < resourcesDataControlList.Count; i++)
            {
                string resourcesPath = currentPath + " >> " + Controller.RESOURCES + " #" + (i + 1);
                valid &= resourcesDataControlList[i].isValid(resourcesPath, incidences);
            }

            valid &= EffectsController.isValid(currentPath + " >> " + TC.get("Element.Effects"), incidences, cutscene.getEffects());

            return(valid);
        }
Beispiel #21
0
    void SpawnCharacter(Player player)
    {
        var point = Terrain.GetSpawnPoint();
        var ch    = Instantiate(characterPrefab, point, Quaternion.identity) as Character;

        if (player != null)
        {
            ch.player         = player;
            player.character  = ch;
            player.spawnDelay = 1f;

            EffectsController.CreateSpawnEffects(point + Vector3.up, player.color);
            SoundController.PlaySoundEffect("CharacterSpawn", 0.4f, point);
        }
    }
        private EffectsController<IVisual> EffectsController; // needed to be controller by this object because of the Tutorial system


        public LevelStartedAnnunciation(Simulator simulator, Level level)
        {
            Simulator = simulator;

            TranslatorMission = new Translator
            (Simulator.Scene, new Vector3(-600, -330, 0), "Alien", Colors.Default.AlienBright, @"Pixelite", Colors.Default.NeutralBright, level.Mission, 4, true, 4000, 250, Preferences.PrioriteGUIHistoire, false);

            EffectsController = new EffectsController<IVisual>();

            EffectsController.Add(TranslatorMission.ToTranslate, EphemereGames.Core.Visual.VisualEffects.FadeInFrom0(255, 1000, 500));
            EffectsController.Add(TranslatorMission.Translated, EphemereGames.Core.Visual.VisualEffects.FadeInFrom0(255, 1000, 500));

            EffectsController.Add(TranslatorMission.ToTranslate, EphemereGames.Core.Visual.VisualEffects.FadeOutTo0(255, 10000, 2000));
            EffectsController.Add(TranslatorMission.Translated, EphemereGames.Core.Visual.VisualEffects.FadeOutTo0(255, 10000, 2000));
        }
        public override void deleteIdentifierReferences(string id)
        {
            if (action.getType() == Action.CUSTOM_INTERACT || action.getType() == Action.CUSTOM)
            {
                // Iterate through the resources
                foreach (ResourcesDataControl resourcesDataControl in resourcesDataControlList)
                {
                    resourcesDataControl.deleteIdentifierReferences(id);
                }
            }

            EffectsController.deleteIdentifierReferences(id, action.getEffects());
            EffectsController.deleteIdentifierReferences(id, action.getNotEffects());
            //  EffectsController.deleteIdentifierReferences( id, action.getClickEffects( ) );
            conditionsController.deleteIdentifierReferences(id);
        }
 public override void updateVarFlagSummary(VarFlagSummary varFlagSummary)
 {
     ConditionsController.updateVarFlagSummary(varFlagSummary, exit.getConditions());
     if (exit.getEffects() != null)
     {
         EffectsController.updateVarFlagSummary(varFlagSummary, exit.getEffects());
     }
     if (exit.getPostEffects() != null)
     {
         EffectsController.updateVarFlagSummary(varFlagSummary, exit.getPostEffects());
     }
     if (exit.getNotEffects() != null)
     {
         EffectsController.updateVarFlagSummary(varFlagSummary, exit.getNotEffects());
     }
 }
        public void Init(EffectsController e)
        {
            var addTex = Resources.Load <Texture2D>("EAdventureData/img/icons/addNode");

            addButton = new GUIContent(addTex);

            EditorWindow.GetWindow <EffectEditorWindow>();
            effectsController          = e;
            effectsEditor              = CreateInstance <EffectsEditor>();
            effectsEditor.Repaint      = Repaint;
            effectsEditor.BeginWindows = BeginWindows;
            effectsEditor.EndWindows   = EndWindows;
            effectsEditor.Init(e);

            EffectEditorFactory.Intance.ResetInstance();
        }
        public override int countIdentifierReferences(string id)
        {
            int count = 0;

            if (cutscene.getTargetId() != null)
            {
                if (cutscene.getTargetId().Equals(id))
                {
                    count++;
                }
            }

            count += EffectsController.countIdentifierReferences(id, cutscene.getEffects());

            return(count);
        }
 public override void deleteAssetReferences(string assetPath)
 {
     exitLookDataControl.deleteAssetReferences(assetPath);
     if (exit.getEffects() != null)
     {
         EffectsController.deleteAssetReferences(assetPath, exit.getEffects());
     }
     if (exit.getPostEffects() != null)
     {
         EffectsController.deleteAssetReferences(assetPath, exit.getPostEffects());
     }
     if (exit.getNotEffects() != null)
     {
         EffectsController.deleteAssetReferences(assetPath, exit.getNotEffects());
     }
 }
 public override void updateVarFlagSummary(VarFlagSummary varFlagSummary)
 {
     // Update the flag summary with the effects of the action
     EffectsController.updateVarFlagSummary(varFlagSummary, action.getEffects());
     if (action.getNotEffects() != null)
     {
         EffectsController.updateVarFlagSummary(varFlagSummary, action.getNotEffects());
     }
     ConditionsController.updateVarFlagSummary(varFlagSummary, action.getConditions());
     if (action.getType() == Action.CUSTOM_INTERACT || action.getType() == Action.CUSTOM)
     {
         foreach (ResourcesDataControl resourcesDataControl in resourcesDataControlList)
         {
             resourcesDataControl.updateVarFlagSummary(varFlagSummary);
         }
     }
 }
Beispiel #29
0
 public BuildUnit(
     UnitCharacteristics characteristics, 
     EntityController.Faction faction, 
     EffectsController effectsController, 
     BaseUnitController.UpdateCharacteristics updateCharacteristics, 
     BaseUnitController.Death updateDeath, 
     BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate,
     Action deleteVisualEffect )
     : base(characteristics, 
         faction, 
         effectsController, 
         updateCharacteristics, 
         updateDeath, 
         setUpdeteCharacteristicsDelegate,
         deleteVisualEffect)
 {
 }
        public override int countAssetReferences(string assetPath)
        {
            int count = 0;

            if (action.getType() == Action.CUSTOM_INTERACT || action.getType() == Action.CUSTOM)
            {
                // Iterate through the resources
                foreach (ResourcesDataControl resourcesDataControl in resourcesDataControlList)
                {
                    count += resourcesDataControl.countAssetReferences(assetPath);
                }
            }
            // Return the asset references from the effects
            count += EffectsController.countAssetReferences(assetPath, action.getEffects());
            count += EffectsController.countAssetReferences(assetPath, action.getNotEffects());
            //  count += EffectsController.countAssetReferences( assetPath, action.getClickEffects( ) );
            return(count);
        }
Beispiel #31
0
    void Update()
    {
        if (cDurability <= 0)
        {
            EffectsController.destroyWeapon(this);
        }
        else if (cDurability < card.health)
        {
            hText.color = Color.red;
        }
        else
        {
            hText.color = Color.green;
        }

        aText.text = cAttack + "";
        hText.text = cDurability + "";
    }
 public HeroUnitController( EntityController.Select entityControllerSelect,
     HeroViewPresentor unitViewPresenter,
     BaseUnit.UnitCharacteristics unitCharacteristics,
     EntityController.GetTarget getTarget,
     EntityController.Faction faction,
     DeathDestroy updateDeath, 
     EntityController.HeroResurrect heroResurrect,
     BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate )
     : base(entityControllerSelect, unitViewPresenter, unitCharacteristics, getTarget, faction, updateDeath, setUpdeteCharacteristicsDelegate)
 {
     this.updateDeath = updateDeath;
     EffectsController effectsController = new EffectsController();
     this.heroResurrect = heroResurrect;
     unitBehaviour.CallDeathFSMEvent();
     unitBehaviour = new HeroBehaviour( getTarget, faction, unitViewPresenter, animationController );
     unitModel = new HeroUnit( "Unit", unitCharacteristics, SpellInit( effectsController ), faction, effectsController, _UpdateCharacteristics, UpdateDeath, LevelUpEffect, setUpdeteCharacteristicsDelegate, DeleteVisualEffect );
     unitView = new HeroView( unitViewPresenter, Selected, GetDamage, ((HeroUnit)unitModel).GetXp );
 }
Beispiel #33
0
    public void Attack()
    {
        UnitBase attacker = gameController.selectedUnit;

        attacker.attacking = true;

        gameController.ClearCrosshairs();

        health -= attacker.attackDamage;
        UpdateHealthDamage();
        if (health <= 0)
        {
            gameController.RemoveUnit(this);
        }
        EffectsController.SpawnHit(truePosition.x, truePosition.y + 0.5f, attacker.attackDamage);

        attacker.SetDown(true);
    }
Beispiel #34
0
 private void Awake()
 {
     lock (padlock)
     {
         if (_instance != null && _instance != this)
         {
             Destroy(this.gameObject);
         }
         else
         {
             _instance = this;
             //Here any additional initialization should occur:
             tornadoIsRunning = false;
             tornadoParticleSystem.Stop();
         }
     }
     //DontDestroyOnLoad(this.gameObject);
 }
        private void Awake()
        {
            Stats        = defaultStats.Clone();
            SubstanceSet = new SubstanceSet();

            effectsController = GetComponent <EffectsController>();

            stateMachine = new PlayerStateMachine(GetComponent <PlayerLSM>());
            stateMachine.OnStateChanged += OnPlayerStateChanged;

            playerColliders.Initialize(this, stateMachine);

            localScale = transform.localScale;

            //Debug.Log("PlayerController IsGroundedHash: " + PlayerLSM.IsGroundedHash + " AnimHash " + Animator.StringToHash("IsGrounded"));
            //GetComponent<Animator>().SetBool(Animator.StringToHash("IsGrounded"), true);
            //inputMaster.Enable();
        }
    public override void onPlay()
    {
        List <Minion> minions      = CardController.getController().getOtherPlayer(self.Player).board;
        List <Minion> validTargets = new List <Minion>();

        foreach (Minion m in minions)
        {
            if (m.cAttack <= 2)
            {
                validTargets.Add(m);
            }
        }
        if (validTargets.Count > 0)
        {
            int    choice = Random.Range(0, validTargets.Count);
            Minion m      = validTargets[choice];
            EffectsController.destroyMinion(m);
        }
    }
        public override bool isValid(string currentPath, List <string> incidences)
        {
            bool valid = true;

            if (exit.getEffects() != null)
            {
                valid &= EffectsController.isValid(currentPath + " >> " + TC.get("Element.Effects"), incidences, exit.getEffects());
            }
            if (exit.getPostEffects() != null)
            {
                valid &= EffectsController.isValid(currentPath + " >> " + TC.get("Element.PostEffects"), incidences, exit.getPostEffects());
            }
            if (exit.getNotEffects() != null)
            {
                valid &= EffectsController.isValid(currentPath + " >> " + TC.get("Element.NotEffects"), incidences, exit.getNotEffects());
            }

            return(valid);
        }
Beispiel #38
0
 public BaseUnit( 
     UnitCharacteristics characteristics, 
     EntityController.Faction faction, 
     EffectsController effectsController, 
     BaseUnitController.UpdateCharacteristics updateCharacteristics, 
     BaseUnitController.Death updateDeath,
     BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate, Action deleteVisualEffect )
 {
     this.deleteVisualEffect = deleteVisualEffect;
     this.setUpdeteCharacteristicsDelegate = setUpdeteCharacteristicsDelegate;
     setUpdeteCharacteristicsDelegate( UpdateBaseCharacteristics, false );
     updateCharacteristicsDelegate = updateCharacteristics;
     this.updateDeath = updateDeath;
     baseCharacteristics = characteristics;
     currentHp = baseCharacteristics.hp;
     this.faction = faction;
     this.effectsController = effectsController;
     UpdateCharacteristics( baseCharacteristics );
 }
Beispiel #39
0
 public HeroUnit( string name, 
     UnitCharacteristics characteristics, 
     Spell[] spells, 
     EntityController.Faction faction, 
     EffectsController effectsController, 
     BaseUnitController.UpdateCharacteristics updateCharacteristics, 
     BaseUnitController.Death updateDeath, 
     HeroUnitController.LevelUpEffectDelegate 
     levelUpEffect, BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate, Action deleteVisualEffect )
     : base(characteristics, 
         faction, 
         effectsController, 
         updateCharacteristics, 
         updateDeath, 
         setUpdeteCharacteristicsDelegate, deleteVisualEffect)
 {
     this.spells = spells;
     this.levelUpEffect = levelUpEffect;
 }
    public BaseUnitController(
        EntityController.Select entityControllerSelect, 
        UnitViewPresenter unitViewPresenter, 
        BaseUnit.UnitCharacteristics unitCharacteristics, 
        EntityController.GetTarget getTarget, 
        EntityController.Faction faction, 
        DeathDestroy updateDeath,
        BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate )
    {
        this.updateDeath = updateDeath;

        animationController = new AnimationController( unitViewPresenter._animation );

        EffectsController effectsController = new EffectsController();

        tempNavMeshAgent = unitViewPresenter.navMeshAgent;

        this.entityControllerSelect = entityControllerSelect;
        unitBehaviour = new BaseUnitBehaviour( getTarget, faction, unitViewPresenter, animationController );
        unitModel = new BaseUnit(unitCharacteristics, faction, effectsController, _UpdateCharacteristics, UpdateDeath, setUpdeteCharacteristicsDelegate, DeleteVisualEffect );
        unitView = new BaseUnitView( unitViewPresenter, Selected, GetDamage );
    }
 public BuildController( EntityController.Select entityControllerSelect,
     BuildViewPresenter unitViewPresenter,
     BaseUnit.UnitCharacteristics unitCharacteristics,
     EntityController.GetTarget getTarget,
     EntityController.Faction faction,
     DeathDestroy updateDeath, 
     BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate )
     : base(entityControllerSelect, 
         unitViewPresenter, 
         unitCharacteristics, 
         getTarget, 
         faction, 
         updateDeath, 
         setUpdeteCharacteristicsDelegate)
 {
     this.updateDeath = updateDeath;
     EffectsController effectsController = new EffectsController();
     unitBehaviour.CallDeathFSMEvent();
     unitBehaviour = new BuildBehaviour( getTarget, faction, unitViewPresenter, animationController );
     unitModel = new BuildUnit( unitCharacteristics, faction, effectsController, _UpdateCharacteristics, UpdateDeath, setUpdeteCharacteristicsDelegate, DeleteVisualEffect );
     BuildView unitView = new BuildView( unitViewPresenter, Selected, ((BuildUnit)unitModel).GetDamage );
     this.unitView = unitView;
 }
Beispiel #42
0
 public Scene(int width, int height)
 {
     Buffer = Visuals.ScenesController.Buffer;
     EnableVisuals = false;
     EnableInputs = false;
     EnableUpdate = false;
     ToDraw = new List<IScenable>();
     ToDrawWithoutCameraForeground = new List<IScenable>();
     ToDrawWithoutCameraBackground = new List<IScenable>();
     Batch = new SpriteBatch(Preferences.GraphicsDeviceManager.GraphicsDevice);
     LastBlend = BlendType.Alpha;
     UpdatedThisTick = false;
     Camera = new Camera(new Vector2(width, height));
     Camera.Origin = new Vector2(width / 2.0f, height / 2.0f);
     Name = name;
     Animations = new AnimationsController(this);
     PhysicalEffects = new EffectsController<IPhysical>();
     VisualEffects = new EffectsController<IVisual>();
     Particles = new ParticlesController(this);
     EphemereGames.Core.Input.Inputs.AddListener(this);
     IdentityMatrix = Matrix.CreateTranslation(width / 2, height / 2, 0);
     DrawMode = DrawMode.Default;
 }
Beispiel #43
0
        public void Fade(int start, int end, EffectsController<IVisual> ec, Core.IntegerHandler callback)
        {
            var effect = VisualEffects.Fade(start, end, 0, 500);

            for (int i = 0; i < MaxVisibleLines; i++)
                ec.Add(Lines[i], effect, callback);
        }
Beispiel #44
0
    public Effect( EffectsController effectsController )
    {
        stackRelationship = new Dictionary<Effect, bool>();

        List<Effect> tempEffects = effectsController.AddEffectToArray(this);
    }
        public AnimationCommodore(string text, double time, double visualPriority)
            : base(time, visualPriority)
        {
            TheLieutenant = new Image("lieutenant", new Vector3(-300, 500, 0))
            {
                SizeX = 6,
                VisualPriority = Preferences.PrioriteGUIMenuPrincipal
            };

            Bubble = new Image("bulle", new Vector3(-100, 300, 0))
            {
                SizeX = 8,
                VisualPriority = Preferences.PrioriteGUIMenuPrincipal + 0.02f,
                Origin = Vector2.Zero
            };

            TypeWriter = new TextTypeWriter
            (
                text,
                Color.Black,
                new Vector3(20, 280, 0),
                @"Pixelite",
                2.0f,
                new Vector2(600, 500),
                50,
                true,
                1000,
                true,
                new List<string>()
                {
                    "sfxLieutenantParle1",
                    "sfxLieutenantParle2",
                    "sfxLieutenantParle3",
                    "sfxLieutenantParle4"
                },
                Scene
            );
            TypeWriter.Text.VisualPriority = Preferences.PrioriteGUIMenuPrincipal;

            GPE = new EffectsController<IPhysical>();
            GVE = new EffectsController<IVisual>();

            MovePathEffect edt = new MovePathEffect();
            edt.Delay = 0;
            edt.Length = this.Duration;
            edt.Progress = Effect<IPhysical>.ProgressType.Linear;
            edt.InnerPath = new Path2D
            (new List<Vector2> { new Vector2(-300, 500), new Vector2(-300, 275), new Vector2(-300, 275), new Vector2(-300, 700) },
             new List<double> { 0, 1000, this.Duration - 1000, this.Duration });

            GPE.Add(TheLieutenant, edt);

            edt = new MovePathEffect();
            edt.Delay = 0;
            edt.Length = this.Duration;
            edt.Progress = Effect<IPhysical>.ProgressType.Linear;
            edt.InnerPath = new Path2D
            (new List<Vector2> { new Vector2(-100, 300), new Vector2(-100, -100), new Vector2(-100, -100), new Vector2(-100, 500) },
             new List<double> { 0, 1000, this.Duration - 1000, this.Duration });

            GPE.Add(Bubble, edt);

            edt = new MovePathEffect();
            edt.Delay = 0;
            edt.Length = this.Duration;
            edt.Progress = Effect<IPhysical>.ProgressType.Linear;
            edt.InnerPath = new Path2D
            (new List<Vector2> { new Vector2(-75, 325), new Vector2(-75, -75), new Vector2(-75, -75), new Vector2(-75, 500) },
             new List<double> { 0, 1000, this.Duration - 1000, this.Duration });

            GPE.Add(TypeWriter.Text, edt);
        }
 private IEnumerator _InvokeBuf( EffectsController.RemoveCoroutineEffect  removeEffect, TimeEffect timeEffect )
 {
     yield return new WaitForSeconds( timeEffect.duration );
     removeEffect( timeEffect );
     yield return null;
 }
    private Spell[] SpellInit( EffectsController effectsController )
    {
        GameObject freezeEffect = (GameObject)Resources.Load( "Prefabs/Particles/Freeze" );
        GameObject meteorShawer = (GameObject)Resources.Load( "Prefabs/Particles/MeteorShower" );

        Spell[] spells = new Spell[2];
        spells[0] = new Spell();

        TimeEffect effect = new TimeEffect( effectsController );
        effect.name = "Freeze";
        effect.characteristicsModifiers.attackSpeed = 0.1f;
        effect.characteristicsModifiers.speed = 0.1f;
        effect.visualPrefab = freezeEffect;
        effect.duration = 10;

        spells[0].aoeRadius = 0;
        spells[0].attackRange = 10;
        spells[0].damage = 15;
        spells[0].healing = 0;
        spells[0].needTarget = true;
        spells[0].effect = effect;
        spells[0].cdTime = 5;
        spells[0].cd = false;

        TimeEffect effect2 = new TimeEffect( effectsController );
        effect2.name = "MeteorShawer";
        effect2.visualPrefab = meteorShawer;
        effect2.duration = 0;

        spells[1] = new Spell();
        spells[1].aoeRadius = 10;
        spells[1].attackRange = 10;
        spells[1].damage = 50;
        spells[1].healing = 0;
        spells[1].needTarget = false;
        spells[1].effect = effect2;
        spells[1].cdTime = 5;
        spells[1].cd = false;

        return spells;
    }
Beispiel #48
0
 void Start()
 {
     _effectsController = GameObject.FindObjectOfType<EffectsController>().GetComponent<EffectsController>();
 }
Beispiel #49
0
 public TimeEffect( EffectsController EffectsController )
     : base(EffectsController)
 {
 }