Exemple #1
0
 public virtual void Init(Level level, TalismanItem sourseItem, int countTalismans)
 {
     this.sourseItem = sourseItem;
     max = sourseItem.costShoot * sourseItem.MaxCharges;
     if (level != null)
     {
         hero = level.MainHero;
         level.OnItemCollected += (id, f, delta) =>
         {
             if (id == ItemId.energy)
             {
                 AddEnergy(delta/countTalismans);
             }
         };
         var db = DataBaseController.Instance;
         var absorber = db.GetEffect(sourseItem.TalismanType);
         if (absorber != null)
         {
             CastEffect = DataBaseController.GetItem<AbsorberWithPosition>(absorber);
             CastEffect.transform.SetParent(hero.transform,false);
         }
     }
     if (DebugController.Instance.ALL_TALISMAN_CHARGED)
     {
         currentEnergy = max;
     }
 }
Exemple #2
0
    public override void Init(Level level, TalismanItem sourseItem, int countTalismans)
    {

        base.Init(level, sourseItem, countTalismans);
        power = Formuls.PowerTalicStandart(LVL_1_P, LVL_10_P, sourseItem.points, sourseItem.enchant);

    }
 public static TalismanItem CreaTalic(int levelResult)
 {
     var totalPoints = GetPointsByLvl(levelResult);
     var type = ShopController.AllTalismanstypes.RandomElement();
     TalismanItem item = new TalismanItem(totalPoints, type);
     return item;
 }
Exemple #4
0
 public static TalismanItem CreaTalic(int levelResult)
 {
     int point = Formuls.GetTalismanPointsByLvl(levelResult);
     point = (int) Utils.RandomNormal(point*0.7f, point*1.3f);
     var type = ShopController.AllTalismanstypes.RandomElement();
     TalismanItem item = new TalismanItem(point, type);
     return item;
 }
Exemple #5
0
    public override void Init(Level level, TalismanItem sourseItem, int countTalismans)
    {
        base.Init(level, sourseItem, countTalismans);

        power = Formuls.PowerTalicStandart(LVL_1_P, LVL_10_P, sourseItem.points, sourseItem.enchant);

        var sefl = (LVL_10_S ) / Formuls.DiffOfTen();
        SefDmg = LVL_1_S +  sourseItem.points * sefl;
    }
 public void Init(TalismanItem talic, int countTalismans)
 {
     this.TalismanItem = talic;
     talicLogic = Talisman.Creat(TalismanItem, countTalismans);
     talicLogic.OnReady += OnReady;
     gameObject.SetActive(true);
     var spr = DataBaseController.Instance.TalismanIcon(talic.TalismanType);
       //  Debug.Log("Talisman inited " + talic.TalismanType + "   " + icon.gameObject.name);
     icon.sprite = spr;
     OnReady(false, 0);
 }
Exemple #7
0
    public void Init(TalismanItem talic, int countTalismans,Level level)
    {
        this.TalismanItem = talic;
        talicLogic = Talisman.Creat(TalismanItem, countTalismans, level);
        talicLogic.OnReady += OnReady;
        RadialImage.type = Image.Type.Filled;

        gameObject.SetActive(true);
        icon.sprite = talic.IconSprite;
        OnReady(false, 0,0);
    }
Exemple #8
0
 public Talisman(TalismanItem sourseItem,int countTalismans)
 {
     this.sourseItem = sourseItem;
     hero = MainController.Instance.level.MainHero;
     MainController.Instance.level.OnItemCollected += (id, f, delta) =>
     {
         if (id == ItemId.energy)
         {
             AddEnergy(delta / countTalismans);
         }
     };
 }
Exemple #9
0
    public static Talisman Creat(TalismanItem sourseItem, int countTalismans, Level level)
    {
        Talisman talic = null;
        switch (sourseItem.TalismanType)
        {
            case TalismanType.massPush:
                //
                break;
            case TalismanType.splitter:
                talic = new TalismanSplitter();
                break;
            case TalismanType.firewave:
                talic = new TalismanFireWave();
                break;
            case TalismanType.massFreez:
//                talic = new TalismanMassFreez(sourseItem, countTalismans);
                break;
            case TalismanType.heal:
                talic = new TalismanHeal();
                break;
            case TalismanType.doubleDamage:
                talic = new TalismanDoubleDamage();
                break;
            case TalismanType.chain:
                talic = new TalismanChain();
                break;
            case TalismanType.energyVamp:
//                talic = new TalismanEnergyVamp(sourseItem, countTalismans);
                break;
            case TalismanType.bloodDamage:
                talic = new TalismanBloodDamage();
                break;
            case TalismanType.trapAOE:
                talic = new TalismanTrapAOE();
                break;
            case TalismanType.trapDamage:
                talic = new TalismanTrapDamage();
                break;
            case TalismanType.trapFreez:
                talic = new TalismanTrapFreez();
                break;
            case TalismanType.megaArmor:
                talic = new TalismanArmor();
                break;

        }
        if (talic == null)
        {
            Debug.LogError("Talic creat error:" + sourseItem.TalismanType);
        }
        talic.Init(level,sourseItem,countTalismans);
        return talic;
    }
Exemple #10
0
 public static TalismanItem Creat(string subStr)
 {
     Debug.Log("TalismanItem Creat from:   " + subStr);
     var pp = subStr.Split(MDEL);
     float power = Convert.ToSingle(pp[0]);
     float costShoot = Convert.ToSingle(pp[1]);
     global::TalismanType type = (TalismanType)Convert.ToInt32(pp[2]);
     bool isEquiped = Convert.ToBoolean(pp[3]);
     TalismanItem talic = new TalismanItem(power,costShoot,type);
     talic.IsEquped = isEquiped;
     return talic;
 }
Exemple #11
0
    public void Init(TalismanItem talismanItem,bool WithButtons)
    {
        base.Init(talismanItem,true, WithButtons);

        var item = Talisman.Creat(talismanItem, 0, null);

        mainIcon.sprite = DataBaseController.Instance.TalismanIcon(talismanItem.TalismanType);
        powerField.text = item.PowerInfo();
        descField.text = "Cost:"  + talismanItem.costShoot.ToString("0") + "\n Charges:" + talismanItem.MaxCharges;
        NameLabel.text = TalismanName(talismanItem.TalismanType);
        
        SetEnchant(talismanItem.enchant, talismanItem.enchant > 0);
    }
Exemple #12
0
    public static Talisman Creat(TalismanItem sourseItem, int countTalismans)
    {
        Talisman talic = null;
        switch (sourseItem.TalismanType)
        {
            case TalismanType.speed:
                talic = new TalismanSpeed(sourseItem,countTalismans);
                break;
            case TalismanType.massPush:

                break;
            case TalismanType.firewave:
                talic = new TalismanFireWave(sourseItem, countTalismans);
                break;
            case TalismanType.massFreez:
                talic = new TalismanMassFreez(sourseItem, countTalismans);
                break;
            case TalismanType.heal:
                talic = new TalismanHeal(sourseItem, countTalismans);
                break;
            case TalismanType.doubleDamage:
                talic = new TalismanDoubleDamage(sourseItem, countTalismans);
                break;
            case TalismanType.chain:
                talic = new TalismanChain(sourseItem, countTalismans);
                break;
            case TalismanType.energyVamp:
                talic = new TalismanEnergyVamp(sourseItem, countTalismans);
                break;
            case TalismanType.bloodDamage:
                talic = new TalismanBloodDamage(sourseItem, countTalismans);
                break;
            case TalismanType.trapAOE:
                talic = new TalismanTrapAOE(sourseItem, countTalismans);
                break;
            case TalismanType.trapDamage:
                talic = new TalismanTrapDamage(sourseItem, countTalismans);
                break;
            case TalismanType.trapFreez:
                talic = new TalismanTrapFreez(sourseItem, countTalismans);
                break;
            case TalismanType.cleave:
                talic = new TalismanCleave(sourseItem, countTalismans);
                break;
        }
        return talic;
    }
Exemple #13
0
 public void Init(Level level, TalismanItem sourseItem, int countTalismans,float lvl_1_time, float offsetToLvl10)
 {
     base.Init(level, sourseItem, countTalismans);
     TimeCoef = Formuls.PowerTalicStandart(lvl_1_time, offsetToLvl10, sourseItem.points, sourseItem.enchant);
 }
    public TalismanTrapFreez(TalismanItem sourseItem, int countTalismans) 
        : base(sourseItem, countTalismans)
    {

    }
    public TalismanChain(TalismanItem sourseItem, int countTalismans) 
        : base(sourseItem, countTalismans)
    {

    }
Exemple #16
0
    private void CheckIfFirstLevel()
    {
        var money = playerInv[ItemId.money] == 0;
        var lvl = Level == 1;
        var items = playerItems.Count == 0;
        if (money && lvl && items)
        {

            PlayerItem item1 = new PlayerItem(new Dictionary<ParamType, float>() { {ParamType.PPower, 15} },Slot.physical_weapon, false,1);
            PlayerItem item2 = new PlayerItem(new Dictionary<ParamType, float>() { { ParamType.MPower, 10 } }, Slot.magic_weapon, false, 1);
            var talisman = new TalismanItem(10,TalismanType.doubleDamage);
            var talisman2 = new TalismanItem(10, TalismanType.heal);
            item1.specialAbilities = SpecialAbility.vampire;
            AddAndEquip(item1);
            AddAndEquip(item2);
            AddAndEquip(talisman);
            AddAndEquip(talisman2);
            listOfOpendBornPositions[1].Add(1);
            foreach (var a in listOfOpendBornPositions[1])
            {
                Debug.Log(">>>>>>>>>>>>>>>>>>>>>>>>  " + a);
            }
            SaveListOfBornPosition();
        }
    }
 public TalismanFireWave(TalismanItem sourseItem, int countTalismans) : base(sourseItem, countTalismans)
 {
 }
    public TalismanEnergyVamp(TalismanItem sourseItem, int countTalismans) 
        : base(sourseItem, countTalismans)
    {

    }
    public TalismanSpeed(TalismanItem sourseItem, int countTalismans) : base(sourseItem, countTalismans)
    {

    }
Exemple #20
0
    public TalismanHeal(TalismanItem sourseItem, int countTalismans) 
        : base(sourseItem, countTalismans)
    {

    }
    public TalismanBloodDamage(TalismanItem sourseItem, int countTalismans) 
        : base(sourseItem, countTalismans)
    {

    }