Exemple #1
0
    public FightInterface init(FightScreen fightScreen)
    {
        this.fightScreen      = fightScreen;
        enemyHealthBar        = transform.Find("Enemy Health Bar").Find("Bar");
        playerHealthBar       = transform.Find("Player Health Bar").Find("Bar");
        enemyArmorValue       = transform.Find("Enemy Armor Value").GetComponent <StrokeText>().init("default", 5);
        enemyBarScale         = enemyHealthBar.localScale;
        playerBarScale        = playerHealthBar.localScale;
        Player.fightInterface = this;

        Transform statusEffectHolder = transform.Find("Player Statuses");

        for (int i = 0; i < statusEffectHolder.childCount; i++)
        {
            fightScreen.playerStatusEffects.Add(statusEffectHolder.GetChild(i).GetComponent <StatusEffect>().init());
        }
        statusEffectHolder = transform.Find("Enemy Statuses");
        for (int i = 0; i < statusEffectHolder.childCount; i++)
        {
            fightScreen.enemyStatusEffects.Add(statusEffectHolder.GetChild(i).GetComponent <StatusEffect>().init());
        }

        gameObject.SetActive(true);

        return(this);
    }
	public void init () {
		Transform equipments = transform.Find("EquipmentHolders");
		equipments.gameObject.SetActive(true);
		EquipmentHolder holder;
		for (int i = 0; i < equipments.childCount; i++) {
			holder = equipments.GetChild(i).GetComponent<EquipmentHolder>();
			holder.init(this);
			equipmentHolders.Add(holder);
		}
		potionBag = Vars.gameplay.getPotionBag();
		foreach (PotionHolder pHolder in potionBag.getPotionHolders()) {
			equipmentHolders.Add(pHolder);
		}

		inventoryManipulator = GetComponent<InventoryManipulator>();
		inventoryManipulator.init(equipmentHolders);

		Transform attributes = transform.Find("Attributes");
		damageValue = attributes.Find("DamageValue").GetComponent<StrokeText>();
		armorValue = attributes.Find("ArmorValue").GetComponent<StrokeText>();
		strengthValue = attributes.Find("StrengthValue").GetComponent<StrokeText>();
		enduranceValue = attributes.Find("EnduranceValue").GetComponent<StrokeText>();
		agilityValue = attributes.Find("AgilityValue").GetComponent<StrokeText>();
		luckValue = attributes.Find("LuckValue").GetComponent<StrokeText>();
		setLayersForText(attributes);
		addAttributes = attributes.Find("AddAttributes").GetComponent<AddAttributes>();
		addAttributes.init();
		transform.Find("BG").gameObject.SetActive(true);
		attributes.gameObject.SetActive(true);
		gameObject.SetActive(false);
	}
Exemple #3
0
    public Perk init()
    {
        expBar    = transform.Find("Exp Bar");
        levelText = transform.Find("Level").GetComponent <StrokeText>().init("Inventory", 6);
        updatePerk();

        return(this);
    }
Exemple #4
0
    public StatusEffect init()
    {
        turnsText  = transform.Find("Turns").GetComponent <StrokeText>().init("default", 5);
        inProgress = false;

        render = GetComponent <SpriteRenderer>();

        gameObject.SetActive(false);

        return(this);
    }
Exemple #5
0
    public FightScreen init(ScanningScreen scanningScreen, StatusScreen statusScreen, ItemDescriptor itemDescriptor)
    {
        this.scanningScreen = scanningScreen;
        this.playerData     = statusScreen.playerData;
        this.itemDescriptor = itemDescriptor;
        this.chambersHolder = statusScreen.cabin.chambersHolder;

        fightProcessor             = GetComponent <FightProcessor>();
        itemDescriptor.fightScreen = this;
        elementsHolder             = transform.Find("Elements Holder").GetComponent <ElementsHolder> ().init(this);;
        iconsHolderRender          = elementsHolder.GetComponent <SpriteRenderer>();
        fightEffectPlayer          = transform.Find("Fight Effect Player").GetComponent <FightEffectPlayer>().init();
        elementEffectPlayer        = transform.Find("ElementEffectPlayer").GetComponent <ElementEffectPlayer>();
        fightInterface             = transform.Find("Fight Interface").GetComponent <FightInterface>().init(this);
        enemy             = transform.Find("Enemy").GetComponent <Enemy>();
        resultScreen      = transform.Find("Fight Result Screen").GetComponent <FightResultScreen>().init(this, statusScreen.cabin.chambersHolder, enemy);
        enemyDeadAnimator = transform.Find("EnemyDeadAnim").GetComponent <Animator>();
        deadStone         = enemyDeadAnimator.transform.Find("DeadStone");
        enemyPos          = enemy.transform.localPosition;
//		elementsHolder.init();
        enemy.init(this);
        elementEffectPlayer.init(this, enemy);
        fightProcessor.init(this, elementsHolder, enemy);

        elementsHolder.gameObject.SetActive(true);
        enemyDeadAnimator.gameObject.SetActive(false);
        gameObject.SetActive(false);

        Transform actionsHolder = transform.Find("Actions Holder");

        actionsHolder.Find("Delimiter").GetComponent <StrokeText>().init("default", 5);
        playerActionsText = actionsHolder.Find("Player Actions").GetComponent <StrokeText>().init("default", 5);
        enemyActionsText  = actionsHolder.Find("Enemy Actions").GetComponent <StrokeText>().init("default", 5);
        actionsHolder.gameObject.SetActive(true);

        Transform  supplyHolder = transform.Find("Supply Holder");
        SupplySlot slot;

        for (int i = 0; i < supplyHolder.childCount; i++)
        {
            slot = supplyHolder.GetChild(i).GetComponent <SupplySlot>();
            slot.init();
            supplySlots.Add(slot);
        }
        supplyHolder.gameObject.SetActive(true);

        captureBtn = transform.Find("Capture Button").GetComponent <Button> ().init();
        releaseBtn = transform.Find("Release Button").GetComponent <Button> ().init();

        Player.fightScreen = this;

        return(this);
    }
    public ScanningDetails init(ScanningScreen scanningScreen)
    {
        this.scanningScreen = scanningScreen;

        enemyImage = transform.Find("Enemy Image").GetComponent <SpriteRenderer>();
        enemyName  = transform.Find("Name").GetComponent <StrokeText>().init("default", 5);
        attackBtn  = transform.Find("Attack Button").GetComponent <Button>().init();
        retreatBtn = transform.Find("Retreat Button").GetComponent <Button>().init();

        gameObject.SetActive(false);

        return(this);
    }
Exemple #7
0
    public BountyOrder init(AnnouncementScreen announcementsScreen)
    {
        this.announcementsScreen = announcementsScreen;
        render = GetComponent <SpriteRenderer>();
        coll   = GetComponent <Collider2D>();

        enemyRender = transform.Find("Enemy Image").GetComponent <SpriteRenderer>();
        rewardValue = transform.Find("Reward Value").GetComponent <StrokeText>().init("default", 3);

        rewardColor       = rewardValue.textColor;
        rewardHalfColor   = rewardColor;
        rewardHalfColor.a = 150;

        gameObject.SetActive(true);

        return(this);
    }
Exemple #8
0
    public FightResultScreen init(FightScreen fightScreen, StasisChambersHolder chambersHolder, Enemy enemy)
    {
        this.fightScreen    = fightScreen;
        this.chambersHolder = chambersHolder;
        this.enemy          = enemy;

        render = transform.Find("Enemy Image").GetComponent <SpriteRenderer>();
//		background = transform.Find("Background");
//		middleground = transform.Find("Middleground");
        foreground        = transform.Find("Foreground");
        chambersAvailable = transform.Find("Chambers Available").GetComponent <StrokeText>().init("FightResultScreen", 5);

        captureBtn = transform.Find("Capture Button").GetComponent <Button>().init();
        releaseBtn = transform.Find("Release Button").GetComponent <Button>().init();

//		this.potionBag = potionBag;
//		location = GameObject.FindGameObjectWithTag("LocationScreen").GetComponent<Location>();
//		valuesHolder = transform.Find("ValuesHolder");
//		rankPointsValue = valuesHolder.Find("RankPointsValue").GetComponent<TextMesh>();
//		goldValue = valuesHolder.Find("GoldValue").GetComponent<TextMesh>();
//		newLevelLabel = valuesHolder.Find("NewLevelLabel").GetComponent<TextMesh>();

//		MeshRenderer mesh = valuesHolder.Find("RankPointsLabel").GetComponent<MeshRenderer>();
//		mesh.sortingLayerName = "FightResultLayer";
//		mesh.sortingOrder = 2;
//		MeshRenderer mesh = valuesHolder.Find("GoldLabel").GetComponent<MeshRenderer>();
//		mesh.sortingLayerName = "FightResultLayer";
//		mesh.sortingOrder = 2;
//		mesh = rankPointsValue.GetComponent<MeshRenderer>();
//		mesh.sortingLayerName = "FightResultLayer";
//		mesh.sortingOrder = 2;
//		mesh = goldValue.GetComponent<MeshRenderer>();
//		mesh.sortingLayerName = "FightResultLayer";
//		mesh.sortingOrder = 2;
//		mesh = newLevelLabel.GetComponent<MeshRenderer>();
//		mesh.sortingLayerName = "FightResultLayer";
//		mesh.sortingOrder = 2;

//		newLevelLabel.gameObject.SetActive(false);
//		valuesHolder.gameObject.SetActive(false);

        clickText = transform.Find("Click Text").GetComponent <StrokeText>().init("FightResultScreen", 6);
        gameObject.SetActive(false);

        return(this);
    }
Exemple #9
0
    public EnemyBlock init(ScanningScreen scanningScreen)
    {
        this.scanningScreen = scanningScreen;
        portrait            = transform.Find("Portrait").GetComponent <SpriteRenderer>();
        enemyName           = transform.Find("Name").GetComponent <StrokeText>().init("default", 3);
        attackBtn           = transform.Find("Attack Button").GetComponent <Button>().init();
        fightResult         = transform.Find("Fight Result Text").GetComponent <TextMesh>();

        MeshRenderer mesh = fightResult.GetComponent <MeshRenderer>();

        mesh.sortingOrder     = portrait.sortingOrder;
        mesh.sortingLayerName = portrait.sortingLayerName;
        fightResult.gameObject.SetActive(false);

        gameObject.SetActive(false);
        return(this);
    }
    public AnnouncementScreen init(PlanetSurface planetSurface, Cabin cabin)
    {
        this.planetSurface = planetSurface;

        cabin.announcementScreen = this;

        enemyImage = transform.Find("Enemy Image").GetComponent <SpriteRenderer> ();

        closeBtn    = transform.Find("Close Button").GetComponent <Button>().init();
        applyBtn    = transform.Find("Apply Button").GetComponent <Button>().init();
        previousBtn = transform.Find("Previous Button").GetComponent <Button> ().init();
        nextBtn     = transform.Find("Next Button").GetComponent <Button> ().init();

        nameText              = transform.Find("Name").GetComponent <StrokeText>().init("default", 5);
        rewardText            = transform.Find("Reward").GetComponent <StrokeText>().init("default", 5);
        planetOfLivingText    = transform.Find("Planet of Living").GetComponent <StrokeText>().init("default", 5);
        destinationPlanetText = transform.Find("Destination Planet").GetComponent <StrokeText> ().init("default", 5);
        appliedText           = transform.Find("Applied").GetComponent <StrokeText>().init("default", 5);

        applyBtn.gameObject.SetActive(true);
        closeBtn.gameObject.SetActive(true);
        previousBtn.gameObject.SetActive(true);
        nextBtn.gameObject.SetActive(true);
        transform.Find("Background").gameObject.SetActive(true);
        transform.Find("Foreground").gameObject.SetActive(true);
        transform.Find("Enemy Image").gameObject.SetActive(true);
        nameText.gameObject.SetActive(true);
        rewardText.gameObject.SetActive(true);
        planetOfLivingText.gameObject.SetActive(true);
        destinationPlanetText.gameObject.SetActive(true);

        randomizeAnnouncements();

        gameObject.SetActive(false);

        return(this);
    }