public void ModifyPlayerAttributesWithEquipment(AStuff <TModuleType> stuff, int negativeOrPositiveOne) { for (short i = 0; i < stuff.blueAttributes.Count; i++) { ModifyPlayerAttribute(stuff.GetAttributeValue(stuff.blueAttributes[i]) * negativeOrPositiveOne, stuff.blueAttributes[i].WhichAttribute); } for (short i = 0; i < stuff.whiteAttributes.Count; i++) { ModifyPlayerAttribute(stuff.GetAttributeValue(stuff.whiteAttributes[i]) * negativeOrPositiveOne, stuff.whiteAttributes[i].WhichAttribute); } }
public List <ObjectAttributeCompared> GetTheWhiteAttributesCompared(AStuff <TModuleType> equippedStuff, AEntityAttribute <APlayer> player) { List <ObjectAttributeCompared> objectAttri = new List <ObjectAttributeCompared>(); int whiteAttributeIndex = 0; if (this is AWeapon <TModuleType> ) { float damageX = this.whiteAttributes[0].Value - equippedStuff.whiteAttributes[0].Value; float damageY = this.whiteAttributes[1].Value - equippedStuff.whiteAttributes[1].Value; objectAttri.Add(new ObjectAttributeCompared("Damage Minimal", damageX, this.whiteAttributes[0].Value)); objectAttri.Add(new ObjectAttributeCompared("Damage Maximal", damageY, this.whiteAttributes[1].Value)); whiteAttributeIndex = 2; } else { var cast = this as ACast <TModuleType>; if (cast != null) { var equippedCast = this as ACast <TModuleType>; float manaCost = cast.ManaCost - equippedCast.ManaCost; objectAttri.Add(new ObjectAttributeCompared("Mana Cost", manaCost, cast.ManaCost)); } } for (; whiteAttributeIndex < this.whiteAttributes.Count; whiteAttributeIndex++) { float difference = this.GetAttributeValue(this.whiteAttributes[whiteAttributeIndex]) - equippedStuff.GetAttributeValue(equippedStuff.whiteAttributes[whiteAttributeIndex]); objectAttri.Add(new ObjectAttributeCompared(this.whiteAttributes[whiteAttributeIndex].WhichAttribute.ToString(), difference, this.GetAttributeValue(this.whiteAttributes[whiteAttributeIndex]))); } objectAttri.Add(new ObjectAttributeCompared("Level Requiered", player.Level - this.levelRequiered, this.levelRequiered)); return(objectAttri); }
public List <ObjectAttributeCompared> GetStuffComparatorThatItemHave(AStuff <TModuleType> equippedStuff) { List <ObjectAttributeCompared> objectAttri = new List <ObjectAttributeCompared>(); for (int stuffIndex = 0; stuffIndex < this.blueAttributes.Count; stuffIndex++) { for (int equippedStuffIndex = 0; equippedStuffIndex < equippedStuff.blueAttributes.Count; equippedStuffIndex++) { if (this.blueAttributes[stuffIndex].WhichAttribute == equippedStuff.blueAttributes[equippedStuffIndex].WhichAttribute) { float difference = this.GetAttributeValue(this.blueAttributes[stuffIndex]) - equippedStuff.GetAttributeValue(equippedStuff.blueAttributes[equippedStuffIndex]); objectAttri.Add(new ObjectAttributeCompared(this.blueAttributes[stuffIndex].WhichAttribute.ToString(), difference, this.GetAttributeValue(this.blueAttributes[stuffIndex]))); } } } return(objectAttri); }