/// <summary> /// Instancie dans un dico les sort de la quantité déterminé /// </summary> /// <param name="quantite">défini la quantité de loot</param> /// <param name="type">defini le type de sort</param> /// <param name="nom">defini le nom du sort</param> /// <param name="list">defini le dico affecté</param> public void InstanciationLootSort(int quantite, TypeSort type, NomSort nom, DicoLoot list) { for (int i = 0; i < quantite; i++) { Loot_Sort sort = new Loot_Sort(); list.Add(this.CaseVide(), sort.CreationSort(type, nom)); } }
/// <summary> /// Verification de la présence d'un sort et application au personnage /// </summary> /// <param name="perso"></param> static void ApplicationSort(Joueur perso) { Loot_Sort sor = new Loot_Sort(); Console.WriteLine("Un objet Trouve"); Point poin = new Point(xpos, ypos); if (list.ContainsKey(poin)) { sor = (Loot_Sort)(list.GetLoot(poin)); sor.Affect(perso); sortname = sor.NomSort; } }
/// <summary> /// renvoie un sort dont le type et la valeur sont définies /// </summary> /// <param name="nomSort"></param> /// <param name="val"></param> /// <returns></returns> public Loot_Sort CreationSort(NomSort nomSort, int val) { //Loot_Sort so = new Loot_Sort(); Point po = new Point(); po.X = 0; po.Y = 0; switch (nomSort) { case NomSort.Vitesse: this.Vitesse += val; this.NomSort = nomSort; break; case NomSort.Force: this.Force += val; this.NomSort = nomSort; break; case NomSort.Teleportation: this.Position = po; this.NomSort = nomSort; break; case NomSort.Combine: this.Force -= val; this.Vitesse -= val; this.NomSort = nomSort; break; case NomSort.Vision: this.Vision += val; this.NomSort = nomSort; break; default: break; } return(this); }
/// <summary> /// renvoie un sort dont le type et le nom sont définie en argument et dont les valeurs sont issue du fichier des settings /// </summary> /// <param name="type"></param> /// <param name="nom"></param> /// <returns></returns> public Loot_Sort CreationSort(TypeSort type, NomSort nom) { Loot_Sort sort = new Loot_Sort(); switch (type) { case TypeSort.Immediat: switch (nom) { case NomSort.Force: Force += constantesLoot.SortForce; this.NomSort = nom; this.TypeSort = type; break; case NomSort.Vitesse: Vitesse += constantesLoot.SortVitesse; this.NomSort = nom; this.TypeSort = type; break; case NomSort.Combine: Force += constantesLoot.SortForce; Vitesse += constantesLoot.SortVitesse; this.NomSort = nom; this.TypeSort = type; break; case NomSort.Teleportation: Position = _position; this.NomSort = nom; this.TypeSort = type; break; case NomSort.Vision: Vision += constantesLoot.SortVision; this.NomSort = nom; this.TypeSort = type; break; } break; case TypeSort.Potion: switch (nom) { case NomSort.Force: Force += constantesLoot.SortPotionForce; this.NomSort = nom; this.TypeSort = type; break; case NomSort.Vitesse: Vitesse += constantesLoot.SortPotionVitesse; this.NomSort = nom; this.TypeSort = type; break; case NomSort.Combine: Force += constantesLoot.SortPotionForce; Vitesse += constantesLoot.SortPotionVitesse; this.NomSort = nom; this.TypeSort = type; break; case NomSort.Teleportation: Position = _position; break; case NomSort.Vision: Vision += constantesLoot.SortPotionVision; this.NomSort = nom; this.TypeSort = type; break; } break; case TypeSort.Carte: switch (nom) { case NomSort.Force: Force -= constantesLoot.SortCarteForce; this.NomSort = nom; this.TypeSort = type; break; case NomSort.Vitesse: Vitesse -= constantesLoot.SortCarteVitesse; this.NomSort = nom; this.TypeSort = type; break; case NomSort.Combine: Force -= constantesLoot.SortCarteForce; Vitesse -= constantesLoot.SortCarteVitesse; this.NomSort = nom; this.TypeSort = type; break; case NomSort.Teleportation: Position = _position; this.NomSort = nom; this.TypeSort = type; break; case NomSort.Vision: Vision -= constantesLoot.SortCarteVision; this.NomSort = nom; this.TypeSort = type; break; } break; default: return(null); } return(sort); }