Thea 2 The Shattering Build 0657(0555)升级 属性 更随机 修改 按取消(cancel) 后 再按升级重新随机属性
本帖最后由 psyduck197 于 2020-3-24 21:42 编辑程式对 属性排序 由人物属性的数值由大到小
然后 程式取数个随机数 取最小值
再来 取属性排序第X个 属性
所以 人物属性的数 越大越容易抽中
我改了 取随机数程式 只且取一次
修改Thea 2 The Shattering Build 0332\Thea2_Data\Managed\Assembly-CSharp.dll
Thea2.Client: CharacterProgression:
private void ItemUpdate(GameObject item, object source, object data, int index)
{
CharacterProgressionListItem cItem = item.GetComponent<CharacterProgressionListItem>();
ClientTurnSummaryData clientTurnSummaryData = source as ClientTurnSummaryData;
ClientGroupData @for = ClientGroupData.GetFor(clientTurnSummaryData.groupID);
ClientEntityCharacter character = null;
if (@for != null)
{
character = (@for.GetEntity(clientTurnSummaryData.relatedValue) as ClientEntityCharacter);
}
if (character == null)
{
foreach (KeyValuePair<int, ClientGroupData> keyValuePair in ClientGroupData.GetAll())
{
if (keyValuePair.Value != null && keyValuePair.Value.GetOwnerID() == RootNetworkManager.GetMyPlayerID())
{
ClientEntity entity = keyValuePair.Value.GetEntity(clientTurnSummaryData.relatedValue);
if (entity != null)
{
character = (entity as ClientEntityCharacter);
}
}
}
}
if (character == null)
{
return;
}
int seed = World.gameSeed ^ character.Id ^ character.Level << 3;
MHRandom mhrandom = new MHRandom(seed);
string instanceName = character.SubraceName;
Subrace instanceFromDB = Globals.GetInstanceFromDB<Subrace>(instanceName);
DBDef.Tag t1 = null;
DBDef.Tag t2 = null;
DBDef.Tag t3 = null;
List<Multitype<Skill, FInt>> chosenSkills = null;
bool flag = character.Level % 2 == 1;
if (flag)
{
List<CountedTag> list = new List<CountedTag>(instanceFromDB.mainSubraceAttributes);
list.Sort((CountedTag a, CountedTag b) => -a.amount.CompareTo(b.amount));
int index2 = Mathf.Min(new int[]
{
//mhrandom.GetInt(0, list.Count),
// mhrandom.GetInt(0, list.Count),
//mhrandom.GetInt(0, list.Count)
UnityEngine.Random.Range(0, list.Count)
});
t1 = list.tag;
list.RemoveAt(index2);
//index2 = Mathf.Min(mhrandom.GetInt(0, list.Count), mhrandom.GetInt(0, list.Count));
index2 = UnityEngine.Random.Range(0, list.Count);
t2 = list.tag;
list.RemoveAt(index2);
//index2 = Mathf.Min(mhrandom.GetInt(0, list.Count), mhrandom.GetInt(0, list.Count));
index2 = UnityEngine.Random.Range(0, list.Count); t3 = list.tag;
list.RemoveAt(index2);
}
if (!flag)
{
List<Multitype<Skill, FInt>> list2 = new List<Multitype<Skill, FInt>>();
if (!NetType.IsNullOrEmpty(character.LearnedSkills))
{
foreach (NetType netType in character.LearnedSkills.value)
{
NetStringFInt2 netStringFInt = (NetStringFInt2)netType;
Skill instanceFromDB2 = Globals.GetInstanceFromDB<Skill>(netStringFInt.name);
FInt value = netStringFInt.value;
if (value < 5 && netStringFInt.value2 == FInt.ZERO)
{
list2.Add(new Multitype<Skill, FInt>(instanceFromDB2, value));
}
}
}
if (instanceFromDB.advancementSkills != null && SkillInstance.skillPacks.ContainsKey(instanceFromDB.advancementSkills))
{
List<Skill> list3 = SkillInstance.skillPacks;
using (List<Skill>.Enumerator enumerator3 = list3.GetEnumerator())
{
while (enumerator3.MoveNext())
{
Skill v = enumerator3.Current;
if (list2.Find((Multitype<Skill, FInt> o) => o.t0 == v) == null)
{
list2.Add(new Multitype<Skill, FInt>(v, FInt.ZERO));
}
}
}
}
list2 = list2.FindAll((Multitype<Skill, FInt> o) => o.t1 * o.t1 < character.Level);
if (list2.Count > 2)
{
chosenSkills = new List<Multitype<Skill, FInt>>();
int @int = mhrandom.GetInt(0, list2.Count);
Multitype<Skill, FInt> multitype = list2[@int];
if (multitype.t1 == FInt.ZERO)
{
@int = mhrandom.GetInt(0, list2.Count);
}
chosenSkills.Add(list2[@int]);
list2.RemoveAt(@int);
int int2 = mhrandom.GetInt(0, list2.Count);
multitype = list2;
if (multitype.t1 == FInt.ZERO)
{
int2 = mhrandom.GetInt(0, list2.Count);
}
chosenSkills.Add(list2);
}
else
{
chosenSkills = list2;
}
}
cItem.characterName.text = character.GetName();
cItem.previousLevel.text = character.Level.ToString();
cItem.newLevel.text = (character.Level + 1).ToString();
cItem.characterIcon.texture = character.GetIcon();
cItem.levelUpIndicator.SetActive(!this.IsSet(character));
RolloverCharacterTooltip.SetCharacter(cItem.characterInputCatch, character);
if (flag)
{
cItem.tagGroup.SetActive(true);
cItem.skillGroup.SetActive(false);
cItem.attribute1Icon.texture = AssetManager.GetTexture(t1);
cItem.attribute2Icon.texture = AssetManager.GetTexture(t2);
cItem.attribute3Icon.texture = AssetManager.GetTexture(t3);
cItem.attribute1Value.text = "+2";
cItem.attribute2Value.text = "+1";
cItem.attribute3Value.text = "+1";
cItem.attribute1.onValueChanged.RemoveAllListeners();
cItem.attribute2.onValueChanged.RemoveAllListeners();
cItem.attribute3.onValueChanged.RemoveAllListeners();
cItem.attribute1.isOn = this.IsTag(character, t1);
cItem.attribute2.isOn = this.IsTag(character, t2);
cItem.attribute3.isOn = this.IsTag(character, t3);
cItem.attribute1.onValueChanged.AddListener(delegate(bool b)
{
this.SetTag(character, t1, 2);
cItem.levelUpIndicator.SetActive(false);
});
RolloverTooltip.SetTag(cItem.attribute1.gameObject, t1);
cItem.attribute2.onValueChanged.AddListener(delegate(bool b)
{
this.SetTag(character, t2, 1);
cItem.levelUpIndicator.SetActive(false);
});
RolloverTooltip.SetTag(cItem.attribute2.gameObject, t2);
cItem.attribute3.onValueChanged.AddListener(delegate(bool b)
{
this.SetTag(character, t3, 1);
cItem.levelUpIndicator.SetActive(false);
});
RolloverTooltip.SetTag(cItem.attribute3.gameObject, t3);
}
else
{
cItem.tagGroup.SetActive(false);
cItem.skillGroup.SetActive(true);
cItem.skill1.onValueChanged.RemoveAllListeners();
cItem.skill2.onValueChanged.RemoveAllListeners();
if (chosenSkills.Count > 0)
{
cItem.skill1Group.SetActive(true);
cItem.skill1Icon.texture = AssetManager.GetTexture(chosenSkills.t0);
cItem.skill1New.SetActive(chosenSkills.t1 == FInt.ZERO);
cItem.skill1.isOn = this.IsSkill(character, chosenSkills.t0.dbName);
cItem.skill1.onValueChanged.AddListener(delegate(bool b)
{
if (b)
{
this.SetSkill(character, chosenSkills.t0.dbName);
cItem.levelUpIndicator.SetActive(false);
}
});
string dbName = chosenSkills.t0.dbName;
FInt t = chosenSkills.t1;
if (t == FInt.ZERO)
{
RolloverSkillTooltip component = cItem.skill1Icon.gameObject.GetComponent<RolloverSkillTooltip>();
if (component != null)
{
UnityEngine.Object.Destroy(component);
}
}
else
{
RolloverSkillTooltip.SetSkill(cItem.skill1Icon.gameObject, new NetStringFInt2(dbName, t, FInt.ZERO), character);
}
RolloverSkillTooltip.SetSkill(cItem.skill1.gameObject, new NetStringFInt2(dbName, t + 1, FInt.ZERO), character);
}
else
{
cItem.skill1Group.SetActive(false);
}
if (chosenSkills.Count > 1)
{
cItem.skill2Group.SetActive(true);
cItem.skill2Icon.texture = AssetManager.GetTexture(chosenSkills.t0);
cItem.skill2New.SetActive(chosenSkills.t1 == FInt.ZERO);
cItem.skill2.isOn = this.IsSkill(character, chosenSkills.t0.dbName);
cItem.skill2.onValueChanged.AddListener(delegate(bool b)
{
if (b)
{
this.SetSkill(character, chosenSkills.t0.dbName);
cItem.levelUpIndicator.SetActive(false);
}
});
string dbName2 = chosenSkills.t0.dbName;
FInt t4 = chosenSkills.t1;
if (t4 == FInt.ZERO)
{
RolloverSkillTooltip component2 = cItem.skill2Icon.gameObject.GetComponent<RolloverSkillTooltip>();
if (component2 != null)
{
UnityEngine.Object.Destroy(component2);
}
}
else
{
RolloverSkillTooltip.SetSkill(cItem.skill2Icon.gameObject, new NetStringFInt2(dbName2, t4, FInt.ZERO), character);
}
RolloverSkillTooltip.SetSkill(cItem.skill2.gameObject, new NetStringFInt2(dbName2, t4 + 1, FInt.ZERO), character);
}
else
{
cItem.skill2Group.SetActive(false);
}
}
}
感谢分享
感谢分享 11111111111111
111111111111
感谢分享 ...33333333333333 感谢分享
感谢分享
呀呀呀呀呀呀晕晕晕晕晕
太棒了,,就是想要修改文件
这个到底修改的什么、 heero99 发表于 2019-8-25 20:53
这个到底修改的什么、
把升级时属性伪随机改掉
升级时要选的3个属性都不满意
按取消在按升级再随机一次
psyduck197 发表于 2019-8-25 21:07
把升级时属性伪随机改掉
升级时要选的3个属性都不满意
嗯,删了后就明白这个补丁的作用了,可以反复选属性,真棒!!
{:3_106:}{:3_106:}{:3_106:}
好东西先下好 :victory::victory: 感谢楼主的分享 十分感谢
666666666666
66666666666666
正需要这个东西
发嘎嘎地方送给
多謝分享
本帖最后由 MOOREDAM 于 2020-1-1 04:05 编辑
0622能用吗?下载的Assembly-CSharp.dll跟0622版的文件大小不一样
zzzzzzzzzzzzzzzzzzzzzzz
水水水水水水水水水水水水
感谢分享 哇塞,大大有点厉害
看起来不错啊
页:
[1]
2