public override void Use(GameObject target = null, Agent agent = null)
        {
            if (target == null || agent == null)
            {
                throw new ArgumentException();
            }
            Leader      leader;
            SolarSystem system = target.GetComponent <SolarSystem>();
            Player      player = agent.GetPlayer();

            if (!player.UseGold(Convert.ToInt32(config.GetCost())))
            {
                return;
            }

            if (system)
            {
                system.GetComponent <PlayerBuildingController>().BuildSpyNetwork(player);
            }


            PlayParticleEffect(agent.gameObject);
            PlayAbilitySound(agent.gameObject);
            PlayAnimation(agent.gameObject);
        }
Exemplo n.º 2
0
        public override void Use(GameObject target = null, Agent agent = null)
        {
            if (target == null || agent == null)
            {
                throw new ArgumentException();
            }
            Leader      leader;
            SolarSystem system = target.GetComponent <SolarSystem>();

            if (system && system.GetEmpire())
            {
                leader = system.GetEmpire().GetLeader();
            }
            else
            {
                throw new ArgumentException("No Leader Target Found");
            }

            Player player = agent.GetPlayer();

            if (leader && player.UseGold((int)config.GetCost()))
            {
                leader.IncreaseInfluence(agent.GetPlayer(), (config as BribeConfig).GetInfluence());
            }

            PlayParticleEffect(agent.gameObject);
            PlayAbilitySound(agent.gameObject);
            PlayAnimation(agent.gameObject);
        }