141 lines
5.0 KiB
C#
141 lines
5.0 KiB
C#
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using TMPro;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
using Random = UnityEngine.Random;
|
||
|
|
||
|
public class Sun_Buildings : Buildings
|
||
|
{
|
||
|
public List<Transform> TuanZi_JiSi_Point = new List<Transform>();
|
||
|
|
||
|
public AudioSource ClickSound;
|
||
|
public int JiSi_num;
|
||
|
public GatheringBall GatheringBall;
|
||
|
public Animator MuYuAnimator;
|
||
|
public ParticleSystem pc;
|
||
|
|
||
|
public override void Start()
|
||
|
{
|
||
|
base.Start();
|
||
|
//初始化基础BuildingTechItem
|
||
|
SpecailBuff_Buildings.BuildingTechItem BlobBTI = new SpecailBuff_Buildings.BuildingTechItem(
|
||
|
null,AddTuanZi, "磕头团子", 0, 0, 1, true,0
|
||
|
);
|
||
|
BlobBTI.SetEndless();
|
||
|
InformationPanel.AddTechItem(BlobBTI);
|
||
|
}
|
||
|
|
||
|
public override void AddFunctionToTreeController()
|
||
|
{
|
||
|
Action Action1 = () => {
|
||
|
AddCeremony("日神初级仪式", 1);
|
||
|
BuildingUpgrade();
|
||
|
};
|
||
|
TreeControl.Instance.AddEvent("日神初级仪式", Action1);
|
||
|
|
||
|
Action Action2 = () => {
|
||
|
AddCeremony("日神中级仪式", 4);
|
||
|
//BuildingUpgrade();
|
||
|
};
|
||
|
TreeControl.Instance.AddEvent("日神中级仪式", Action2);
|
||
|
|
||
|
Action Action3 = () => {
|
||
|
AddCeremony("日神高级仪式", 7);
|
||
|
};
|
||
|
TreeControl.Instance.AddEvent("日神高级仪式", Action3);
|
||
|
}
|
||
|
public override void AddResources_Click()
|
||
|
{
|
||
|
int add = (int)(
|
||
|
(1+ GlobalBuffSystem.Instance.ClickAdder) * GlobalBuffSystem.Instance.ClickTimeMultiplier* GlobalBuffSystem.Instance.ClickMultiplier*ClickBuff*OutputBuff* GlobalBuffSystem.Instance.GlobalMultiplier
|
||
|
);
|
||
|
Debug.Log("木鱼产出 "+add);
|
||
|
ClickSound.Play();
|
||
|
MuYuAnimator.Play("Qiao");
|
||
|
GatheringBall.AddFaith(add);
|
||
|
pc.Emit(add);
|
||
|
//Debug.Log(GlobalBuffSystem.Instance.ClickAdder);
|
||
|
}
|
||
|
public override void AddResources_Auto()
|
||
|
{
|
||
|
//改为高度依赖团子演出的产出
|
||
|
/*GameProcedureManager.Instance.FaithCount += (int)(
|
||
|
(TuanZi_efficiency * TuanZi_Num)*
|
||
|
(GlobalBuffSystem.Instance.GlobalMultiplier * LocalBuff_Auto * ReserveBuff_Auto * (efficiency_Level_Auto[Level] * SpecalBuffMuti_efficiency_Auto + SpecalBuffAdd_efficiency_Auto))
|
||
|
);*/
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
public void KowTowGenerate(ParticleSystem ps)
|
||
|
{
|
||
|
|
||
|
int generatedCount = (int)(
|
||
|
TuanZi_efficiency *
|
||
|
(GlobalBuffSystem.Instance.GlobalMultiplier *
|
||
|
LocalBuff_Auto * ReserveBuff_Auto *
|
||
|
(efficiency_Level_Auto[1] * SpecalBuffMuti_efficiency_Auto + SpecalBuffAdd_efficiency_Auto)) +
|
||
|
Jisi_Add_Auto
|
||
|
);
|
||
|
Debug.Log($"{TuanZi_efficiency}+{GlobalBuffSystem.Instance.GlobalMultiplier}+{LocalBuff_Auto}+{ReserveBuff_Auto}+{efficiency_Level_Auto[1] }+{SpecalBuffMuti_efficiency_Auto}+{SpecalBuffAdd_efficiency_Auto}");
|
||
|
//print($"日建筑产生{generatedCount}个信仰");
|
||
|
//基于不同产量产出不同光点
|
||
|
for (int i = 0; i < generatedCount; i++)
|
||
|
{
|
||
|
GatheringBall.AddFaith(1);
|
||
|
AudioManager.Instance.PlayFaithGainSFX(0.8f);
|
||
|
ps.Emit(1);
|
||
|
//GatheringBall.AddBall(go, transform.position + (Vector3)Random.insideUnitCircle * 0.2f);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
public override void AddTuanZi()
|
||
|
{
|
||
|
AudioManager.Instance.PlayHoly(GetComponent<AudioSource>());
|
||
|
BlobController tuanzi = BlobManager.Instance.AvailableBlobs[0];
|
||
|
tuanzi.gameObject.GetComponent<SpriteRenderer>().sortingLayerID = 10;
|
||
|
TuanZiList.Add(BlobManager.Instance.AvailableBlobs[0]);
|
||
|
tuanzi.BelongingBuilding = this;
|
||
|
//设置团子位置
|
||
|
if (TuanZiPoint.Count == 0)
|
||
|
{
|
||
|
tuanzi.transform.position = transform.position;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
Vector3 point = TuanZiPoint[TuanZi_Num % TuanZiPoint.Count].position;
|
||
|
tuanzi.transform.position = new Vector3(point.x, point.y - (TuanZi_Num / TuanZiPoint.Count) * 0.33f, point.z);
|
||
|
}
|
||
|
|
||
|
TuanZi_Num++;
|
||
|
tuanzi.GetComponent<Animator>().Play("Kowtow 1");
|
||
|
}
|
||
|
|
||
|
public void AddTuanZi_JiSi()
|
||
|
{
|
||
|
BlobController tuanzi = BlobManager.Instance.AvailableBlobs[0];
|
||
|
tuanzi.gameObject.GetComponent<SpriteRenderer>().sortingLayerID = 10;
|
||
|
//设置团子位置
|
||
|
if (TuanZi_JiSi_Point.Count == 0)
|
||
|
{
|
||
|
tuanzi.transform.position = transform.position;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
Vector3 point = TuanZi_JiSi_Point[TuanZi_Num % TuanZi_JiSi_Point.Count].position;
|
||
|
tuanzi.transform.position = new Vector3(point.x, point.y - (TuanZi_Num / TuanZi_JiSi_Point.Count) * 0.33f, point.z);
|
||
|
}
|
||
|
TuanZiList.Add(BlobManager.Instance.AvailableBlobs[0]);
|
||
|
tuanzi.BelongingBuilding = this;
|
||
|
|
||
|
TuanZi_Num++;
|
||
|
JiSi_num++;
|
||
|
tuanzi.GetComponent<Animator>().Play("Kowtow_JiSi 1");
|
||
|
}
|
||
|
}
|