1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734
| Option Explicit ' Merge : fusion des équipements d'un jeu en ligne
' dans le but de trouver un équipement recherché en fonction des équipements que l'on possède déjà
' By Mangaku and MattChess, August 20, 2011 Version 0.7
' =========================== Feuille source des données
Public Const nomFeuilleSrcDFusion = "Données Fusion" ' Tableau de corrélation des fusions entre les différents éléments
Public Const indObjRing = 1, indObjFirst = indObjRing ' Première famille d'objet Anneaux
Public Const indObjAmu = indObjRing + 1 ' Amulettes
Public Const indObjCaC1H = indObjAmu + 1 ' Armes 1 main
Public Const indObjCaC2H = indObjCaC1H + 1 ' Armes 2 mains
Public Const indObjHat = indObjCaC2H + 1 ' Casques
Public Const indObjPant = indObjHat + 1 ' Pantalons
Public Const indObjArmor = indObjPant + 1 ' Armures
Public Const indObjAad = indObjArmor + 1 ' Armes à distance
Public Const indObjLast = indObjAad ' Dernière famille d'objets
Public Const indTypeObj = 0
Public Const indSupport = 1, indTypePropertyFirst = indSupport ' Première propriété d'un objet
Public Const indPrefixe = indSupport + 1
Public Const indSuffixe = indPrefixe + 1
Public Const indTypePropertyLast = indSuffixe ' Dernière propriété d'un objet
Public Const nbrRowHeader = 1
Public Const nbrRowInter = 2 + nbrRowHeader ' Nombre de rangées entre deux tableaux dans une famille
Public Const nbrRowFamily = 6 + nbrRowHeader ' Nombre de rangées entre deux familles
Public Const colObjFirst = 5 ' Colonne E de la matrice par support, prefixe, suffixe
Public Const colObjName = 35 ' Colonne AI Nom de chaque support, prefixe, suffixe
' =======================================================================================================
' ================================ Description de chaque famille d'objet ================================
' =======================================================================================================
' ================================ Ring ================================
' Données Anneaux Support
Public Const nbrMaxRingSupp = 3 ' La famille RingSupp a 3 valeurs possibles
Public Const rowRingSuppStart = 6 ' Première rangée de la famille RingSupp
Public Const rowRingSuppEnd = rowRingSuppStart + nbrMaxRingSupp - 1 ' Dernière rangée de la famille RingSupp
Public Const indPropertyFirst = 1
Public Const indRingSuppAnneau = indPropertyFirst ' Premier support de la famille RingSupp
Public Const indRingSuppFirst = indRingSuppAnneau
Public Const indRingSuppBracelet = indRingSuppAnneau + 1
Public Const indRingSuppChevaliere = indRingSuppBracelet + 1
Public Const indRingSuppLast = indRingSuppChevaliere ' Dernier support de la famille RingSupp
' Données Anneaux Prefixe
Public Const nbrMaxRingPref = 28 ' La famille RingPref a 28 prefixes possibles
Public Const nbrMaxProperties = nbrMaxRingPref ' Nombre maximum de propriétés
Public Const rowRingPrefStart = rowRingSuppStart + nbrMaxRingSupp + nbrRowInter ' Première rangée de la famille RingPref
Public Const rowRingPrefEnd = rowRingPrefStart + nbrMaxRingPref - 1 ' Dernière rangée de la famille RingPref
Public Const indRingPrefBronze = indPropertyFirst ' Premier prefixe de la famille RingPref
Public Const indRingPrefFirst = indRingPrefBronze
Public Const indRingPrefArgent = indRingPrefBronze + 1
Public Const indRingPrefEmeraude = indRingPrefArgent + 1
Public Const indRingPrefOr = indRingPrefEmeraude + 1
Public Const indRingPrefPlatine = indRingPrefOr + 1
Public Const indRingPrefTitane = indRingPrefPlatine + 1
Public Const indRingPrefRubis = indRingPrefTitane + 1
Public Const indRingPrefDistingue = indRingPrefRubis + 1
Public Const indRingPrefAstucieux = indRingPrefDistingue + 1
Public Const indRingPrefOurs = indRingPrefAstucieux + 1
Public Const indRingPrefDur = indRingPrefOurs + 1
Public Const indRingPrefAstral = indRingPrefDur + 1
Public Const indRingPrefElastique = indRingPrefAstral + 1
Public Const indRingPrefCardinal = indRingPrefElastique + 1
Public Const indRingPrefNecromancien = indRingPrefCardinal + 1
Public Const indRingPrefArchaique = indRingPrefNecromancien + 1
Public Const indRingPrefHypnotique = indRingPrefArchaique + 1
Public Const indRingPrefDansant = indRingPrefHypnotique + 1
Public Const indRingPrefFauve = indRingPrefDansant + 1
Public Const indRingPrefDiamant = indRingPrefFauve + 1
Public Const indRingPrefVindicatif = indRingPrefDiamant + 1
Public Const indRingPrefFausse = indRingPrefVindicatif + 1
Public Const indRingPrefPlastique = indRingPrefFausse + 1
Public Const indRingPrefInsidieux = indRingPrefPlastique + 1
Public Const indRingPrefSolaire = indRingPrefInsidieux + 1
Public Const indRingPrefAraignee = indRingPrefSolaire + 1
Public Const indRingPrefFaucon = indRingPrefAraignee + 1
Public Const indRingPrefNoir = indRingPrefFaucon + 1
Public Const indRingPrefLast = indRingPrefNoir ' Dernier prefixe de la famille RingPref
' Données Anneaux Suffixe
Public Const nbrMaxRingSuff = 20 ' La famille RingSuff a 20 suffixes possibles
Public Const rowRingSuffStart = rowRingPrefStart + nbrMaxRingPref + nbrRowInter ' Première rangée de la famille RingSuff
Public Const rowRingSuffEnd = rowRingSuffStart + nbrMaxRingSuff - 1 ' Dernière rangée de la famille RingSuff
Public Const indRingSuffDelit = indPropertyFirst ' Premier suffixe de la famille RingSuff
Public Const indRingSuffFirst = indRingSuffDelit
Public Const indRingSuffBeaute = indRingSuffDelit + 1
Public Const indRingSuffPouvoir = indRingSuffBeaute + 1
Public Const indRingSuffForce = indRingSuffPouvoir + 1
Public Const indRingSuffGenie = indRingSuffForce + 1
Public Const indRingSuffSagesse = indRingSuffGenie + 1
Public Const indRingSuffPeauDur = indRingSuffSagesse + 1
Public Const indRingSuffLoupGarou = indRingSuffPeauDur + 1
Public Const indRingSuffArt = indRingSuffLoupGarou + 1
Public Const indRingSuffJustesse = indRingSuffArt + 1
Public Const indRingSuffJouvence = indRingSuffJustesse + 1
Public Const indRingSuffRenard = indRingSuffJouvence + 1
Public Const indRingSuffChance = indRingSuffRenard + 1
Public Const indRingSuffSang = indRingSuffChance + 1
Public Const indRingSuffChauveSouris = indRingSuffSang + 1
Public Const indRingSuffConcentration = indRingSuffChauveSouris + 1
Public Const indRingSuffLevitation = indRingSuffConcentration + 1
Public Const indRingSuffAstuce = indRingSuffLevitation + 1
Public Const indRingSuffDement = indRingSuffAstuce + 1
Public Const indRingSuffFacilite = indRingSuffDement + 1
Public Const indRingSuffLast = indRingSuffFacilite ' Dernier suffixe de la famille RingSuff
' ================================ Amu ================================
' =====================================================================
'
' Données Amulettes (Amu) Support
Public Const nbrMaxAmuSupp = 5 ' La famille AmuSupp a 5 supports possibles
Public Const rowAmuSuppStart = rowRingSuffStart + nbrMaxRingSuff + nbrRowFamily ' Première rangée de la famille AmuSupp
Public Const rowAmuSuppEnd = rowAmuSuppStart + nbrMaxAmuSupp - 1 ' Dernière rangée de la famille AmuSupp
Public Const indAmuSuppCollier = indPropertyFirst ' Premier support de la famille AmuSupp
Public Const indAmuSuppCravate = nbrMaxAmuSupp ' Dernier support de la famille AmuSupp
' Donnée Amu Prefixe
Public Const nbrMaxAmuPref = 28 ' La famille AmuPref a 28 Prefixes possibles
Public Const rowAmuPrefStart = rowAmuSuppStart + nbrMaxAmuSupp + nbrRowInter ' Première rangée de la famille AmuPref
Public Const rowAmuPrefEnd = rowAmuPrefStart + nbrMaxAmuPref - 1 ' Dernière rangée de la famille AmuPref
Public Const indAmuPrefBronze = indPropertyFirst ' Premier prefixe de la famille AmuPref
Public Const indAmuPrefNoir = nbrMaxAmuPref ' Dernier prefixe de la famille AmuPref
' Donnée Amu Suffixe
Public Const nbrMaxAmuSuff = 20 ' La famille AmuSuff a 20 Suffixes possibles
Public Const rowAmuSuffStart = rowAmuPrefStart + nbrMaxAmuPref + nbrRowInter ' Première rangée de la famille AmuSuff
Public Const rowAmuSuffEnd = rowAmuSuffStart + nbrMaxAmuSuff - 1 ' Dernière rangée de la famille AmuSuff
Public Const indAmuSuffDelit = indPropertyFirst ' Premier suffixe de la famille AmuSuff
Public Const indAmuSuffFacilité = nbrMaxAmuSuff ' Dernier suffixe de la famille AmuSuff
' ================================ CaC1H ================================
' =======================================================================
'
' Données Armes 1main (CaC1H) Support
Public Const nbrMaxCaC1HSupp = 10 ' La famille CaC1HSupp a 10 supports possibles
Public Const rowCaC1HSuppStart = rowAmuSuffStart + nbrMaxAmuSuff + nbrRowFamily ' Première rangée de la famille CaC1HSupp
Public Const rowCaC1HSuppEnd = rowCaC1HSuppStart + nbrMaxCaC1HSupp - 1 ' Dernière rangée de la famille CaC1HSupp
Public Const indCaC1HSuppMatraque = indPropertyFirst ' Premier support de la famille CaC1HSupp
Public Const indCaC1HSuppCieux = nbrMaxCaC1HSupp ' Dernier support de la famille CaC1HSupp
' Donnée CaC1H Prefixe
Public Const nbrMaxCaC1HPref = 20 ' La famille CaC1HPref a 20 Prefixes possibles
Public Const rowCaC1HPrefStart = rowCaC1HSuppStart + nbrMaxCaC1HSupp + nbrRowInter ' Première rangée de la famille CaC1HPref
Public Const rowCaC1HPrefEnd = rowCaC1HPrefStart + nbrMaxCaC1HPref - 1 ' Dernière rangée de la famille CaC1HPref
Public Const indCaC1HPrefSevere = indPropertyFirst ' Premier prefixe de la famille CaC1HPref
Public Const indCaC1HPrefDemoniaque = nbrMaxCaC1HPref ' Dernier prefixe de la famille CaC1HPref
' Donnée CaC1H Suffixe
Public Const nbrMaxCaC1HSuff = 22 ' La famille CaC1HSuff a 22 Suffixes possibles
Public Const rowCaC1HSuffStart = rowCaC1HPrefStart + nbrMaxCaC1HPref + nbrRowInter ' Première rangée de la famille CaC1HSuff
Public Const rowCaC1HSuffEnd = rowCaC1HSuffStart + nbrMaxCaC1HSuff - 1 ' Dernière rangée de la famille CaC1HSuff
Public Const indCaC1HSuffCommandant = indPropertyFirst ' Premier suffixe de la famille CaC1HSuff
Public Const indCaC1HSuffEmpereur = nbrMaxCaC1HSuff ' Dernier suffixe de la famille CaC1HSuff
' ================================ CaC2H ================================
' =======================================================================
'
' Données Armes 2mains (CaC2H) Support
Public Const nbrMaxCaC2HSupp = 10 ' La famille CaC2HSupp a 10 supports possibles
Public Const rowCaC2HSuppStart = rowCaC1HSuffStart + nbrMaxCaC1HSuff + nbrRowFamily ' Première rangée de la famille CaC2HSupp
Public Const rowCaC2HSuppEnd = rowCaC2HSuppStart + nbrMaxCaC2HSupp - 1 ' Dernière rangée de la famille CaC2HSupp
Public Const indCaC2HSuppMassue = indPropertyFirst ' Premier support de la famille CaC2HSupp
Public Const indCaC2HSuppTronconneuse = nbrMaxCaC2HSupp ' Dernier support de la famille CaC2HSupp
' Donnée CaC2H Prefixe
Public Const nbrMaxCaC2HPref = 21 ' La famille CaC2HPref a 21 Prefixes possibles
Public Const rowCaC2HPrefStart = rowCaC2HSuppStart + nbrMaxCaC2HSupp + nbrRowInter ' Première rangée de la famille CaC2HPref
Public Const rowCaC2HPrefEnd = rowCaC2HPrefStart + nbrMaxCaC2HPref - 1 ' Dernière rangée de la famille CaC2HPref
Public Const indCaC2HPrefDispendieux = indPropertyFirst ' Premier prefixe de la famille CaC2HPref
Public Const indCaC2HPrefDemoniaque = nbrMaxCaC2HPref ' Dernier prefixe de la famille CaC2HPref
' Donnée CaC2H Suffixe
Public Const nbrMaxCaC2HSuff = 18 ' La famille CaC2HSuff a 18 Suffixes possibles
Public Const rowCaC2HSuffStart = rowCaC2HPrefStart + nbrMaxCaC2HPref + nbrRowInter ' Première rangée de la famille CaC2HSuff
Public Const rowCaC2HSuffEnd = rowCaC2HSuffStart + nbrMaxCaC2HSuff - 1 ' Dernière rangée de la famille CaC2HSuff
Public Const indCaC2HSuffTrahison = indPropertyFirst ' Premier suffixe de la famille CaC2HSuff
Public Const indCaC2HSuffDracula = nbrMaxCaC2HSuff ' Dernier suffixe de la famille CaC2HSuff
' ================================ Hat ================================
' =====================================================================
'
' Données Casques (Hat) Support
Public Const nbrMaxHatSupp = 10 ' La famille HatSupp a 10 supports possibles
Public Const rowHatSuppStart = rowCaC2HSuffStart + nbrMaxCaC2HSuff + nbrRowFamily ' Première rangée de la famille HatSupp
Public Const rowHatSuppEnd = rowHatSuppStart + nbrMaxHatSupp - 1 ' Dernière rangée de la famille HatSupp
Public Const indHatSuppCasquette = indPropertyFirst ' Premier support de la famille HatSupp
Public Const indHatSuppCouronne = nbrMaxHatSupp ' Dernier support de la famille HatSupp
' Donnée Hat Prefixe
Public Const nbrMaxHatPref = 19 ' La famille HatPref a 19 Prefixes possibles
Public Const rowHatPrefStart = rowHatSuppStart + nbrMaxHatSupp + nbrRowInter ' Première rangée de la famille HatPref
Public Const rowHatPrefEnd = rowHatPrefStart + nbrMaxHatPref - 1 ' Dernière rangée de la famille HatPref
Public Const indHatPrefEndurci = indPropertyFirst ' Premier prefixe de la famille HatPref
Public Const indHatPrefRituel = nbrMaxHatPref ' Dernier prefixe de la famille HatPref
' Donnée Hat Suffixe
Public Const nbrMaxHatSuff = 18 ' La famille HatSuff a 18 Suffixes possibles
Public Const rowHatSuffStart = rowHatPrefStart + nbrMaxHatPref + nbrRowInter ' Première rangée de la famille HatSuff
Public Const rowHatSuffEnd = rowHatSuffStart + nbrMaxHatSuff - 1 ' Dernière rangée de la famille HatSuff
Public Const indHatSuffExplorateur = indPropertyFirst ' Premier suffixe de la famille HatSuff
Public Const indHatSuffMagie = nbrMaxHatSuff ' Dernier suffixe de la famille HatSuff
' ================================ Pant ================================
' ======================================================================
'
' Données Pantalons (Pant) Support
Public Const nbrMaxPantSupp = 4 ' La famille PantSupp a 4 supports possibles
Public Const rowPantSuppStart = rowHatSuffStart + nbrMaxHatSuff + nbrRowFamily ' Première rangée de la famille PantSupp
Public Const rowPantSuppEnd = rowPantSuppStart + nbrMaxPantSupp - 1 ' Dernière rangée de la famille PantSupp
Public Const indPantSuppShort = indPropertyFirst ' Premier support de la famille PantSupp
Public Const indPantSuppKilt = nbrMaxPantSupp ' Dernier support de la famille PantSupp
' Donnée Pant Prefixe
Public Const nbrMaxPantPref = 17 ' La famille PantPref a 17 Prefixes possibles
Public Const rowPantPrefStart = rowPantSuppStart + nbrMaxPantSupp + nbrRowInter ' Première rangée de la famille PantPref
Public Const rowPantPrefEnd = rowPantPrefStart + nbrMaxPantPref - 1 ' Dernière rangée de la famille PantPref
Public Const indPantPrefCourt = indPropertyFirst ' Premier prefixe de la famille PantPref
Public Const indPantPrefMortel = nbrMaxPantPref ' Dernier prefixe de la famille PantPref
' Donnée Pant Suffixe
Public Const nbrMaxPantSuff = 15 ' La famille PantSuff a 15 Suffixes possibles
Public Const rowPantSuffStart = rowPantPrefStart + nbrMaxPantPref + nbrRowInter ' Première rangée de la famille PantSuff
Public Const rowPantSuffEnd = rowPantSuffStart + nbrMaxPantSuff - 1 ' Dernière rangée de la famille PantSuff
Public Const indPantSuffBrigand = indPropertyFirst ' Premier suffixe de la famille PantSuff
Public Const indPantSuffNuit = nbrMaxPantSuff ' Dernier suffixe de la famille PantSuff
' ================================ Armor ================================
' =======================================================================
'
' Données Armoralons (Armor) Support
Public Const nbrMaxArmorSupp = 10 ' La famille ArmorSupp a 10 supports possibles
Public Const rowArmorSuppStart = rowPantSuffStart + nbrMaxPantSuff + nbrRowFamily ' Première rangée de la famille ArmorSupp
Public Const rowArmorSuppEnd = rowArmorSuppStart + nbrMaxArmorSupp - 1 ' Dernière rangée de la famille ArmorSupp
Public Const indArmorSuppTShirt = indPropertyFirst ' Premier support de la famille ArmorSupp
Public Const indArmorSuppPleineArmure = nbrMaxArmorSupp ' Dernier support de la famille ArmorSupp
' Donnée Armor Prefixe
Public Const nbrMaxArmorPref = 16 ' La famille ArmorPref a 16 Prefixes possibles
Public Const rowArmorPrefStart = rowArmorSuppStart + nbrMaxArmorSupp + nbrRowInter ' Première rangée de la famille ArmorPref
Public Const rowArmorPrefEnd = rowArmorPrefStart + nbrMaxArmorPref - 1 ' Dernière rangée de la famille ArmorPref
Public Const indArmorPrefRenforce = indPropertyFirst ' Premier prefixe de la famille ArmorPref
Public Const indArmorPrefMortel = nbrMaxArmorPref ' Dernier prefixe de la famille ArmorPref
' Donnée Armor Suffixe
Public Const nbrMaxArmorSuff = 20 ' La famille ArmorSuff a 20 Suffixes possibles
Public Const rowArmorSuffStart = rowArmorPrefStart + nbrMaxArmorPref + nbrRowInter ' Première rangée de la famille ArmorSuff
Public Const rowArmorSuffEnd = rowArmorSuffStart + nbrMaxArmorSuff - 1 ' Dernière rangée de la famille ArmorSuff
Public Const indArmorSuffVoleur = indPropertyFirst ' Premier suffixe de la famille ArmorSuff
Public Const indArmorSuffOrchidee = nbrMaxArmorSuff ' Dernier suffixe de la famille ArmorSuff
' ================================ Aad ================================
' =======================================================================
'
' Données Aadalons (Aad) Support
Public Const nbrMaxAadSupp = 11 ' La famille AadSupp a 11 supports possibles
Public Const rowAadSuppStart = rowArmorSuffStart + nbrMaxArmorSuff + nbrRowFamily ' Première rangée de la famille AadSupp
Public Const rowAadSuppEnd = rowAadSuppStart + nbrMaxAadSupp - 1 ' Dernière rangée de la famille AadSupp
Public Const indAadSuppArcCourt = indPropertyFirst ' Premier support de la famille AadSupp
Public Const indAadSuppFirst = indAadSuppArcCourt
Public Const indAadSuppArc = indAadSuppArcCourt + 1
Public Const indAadSuppShuriken = indAadSuppArc + 1
Public Const indAadSuppCouteauLancer = indAadSuppShuriken + 1
Public Const indAadSuppArcLong = indAadSuppCouteauLancer + 1
Public Const indAadSuppFranscique = indAadSuppArcLong + 1
Public Const indAadSuppArbalete = indAadSuppFranscique + 1
Public Const indAadSuppArcReflexe = indAadSuppArbalete + 1
Public Const indAadSuppJavelot = indAadSuppArcReflexe + 1
Public Const indAadSuppPilum = indAadSuppJavelot + 1
Public Const indAadSuppArbaleteLourde = indAadSuppPilum + 1
Public Const indAadSuppLast = indAadSuppArbaleteLourde ' Dernier support de la famille AadSupp
' Données Armes à Distance (AAD) Suffixe
Public Const nbrMaxAadSuff = 8 ' La famille AadSuff a 8 suffixes possibles
Public Const rowAadSuffStart = rowAadSuppStart + nbrMaxAadSupp + nbrRowInter ' Première rangée de la famille AadSuff
Public Const rowAadSuffEnd = rowAadSuffStart + nbrMaxAadSuff - 1 ' Dernière rangée de la famille AadSuff
Public Const indAadSuffLonguePortee = indPropertyFirst
Public Const indAadSuffFirst = indAadSuffLonguePortee ' Premier suffixe de la famille AadSuff
Public Const indAadSuffPerfection = indAadSuffLonguePortee + 1
Public Const indAadSuffPrecision = indAadSuffPerfection + 1
Public Const indAadSuffVengeance = indAadSuffPrecision + 1
Public Const indAadSuffReaction = indAadSuffVengeance + 1
Public Const indAadSuffDryades = indAadSuffReaction + 1
Public Const indAadSuffMitraillage = indAadSuffDryades + 1
Public Const indAadSuffLoups = indAadSuffMitraillage + 1
Public Const indAadSuffLast = indAadSuffLoups ' Dernier suffixe de la famille AadSuff
' =========================== Feuille cible résultat à partir de la cible pour un stock donné
' Feuille d'insertion du Stock possédé, et de sélection de l'objet Cible désiré.
Public Const nomFeuilleTarget = "Fusion" ' Bouton de lancement de recherche des solutions
' Définition de la C I B L E
' Les paramètres d'entrée sont: l'objet cible = un support, un prefixe, un suffixe
' Pour les Armes a Distance, le prefixe est inexistant = 0
' La vérification syntaxique de l'objet cible est assurée par IsIndexOk()
' Les paramètres de sortie sont: les solutions pour obtenir l'objet cible.
' Un classement croissant fonction du nombre de fusions à réaliser pour obtenir l'objet cible serait un plus
' Définition du S T O C K
' Les objets en stock devront être rentrés manuellement par l'utilisateur sur la feuille.
' Une colonne pour les supports, une pour les préfixes, une pour les suffixes
' La correlation pour le mélange entre deux objets étant fournies par le tableau arrObjName
' Exemple: Anneau + Chevalière = Bracelet
' La vérification syntaxique des objets en stock est assurée par IsObjOk()
' ============================================
Type ObjectType ' Clé unique identifiant un objet
Family As Byte
Suppport As Byte
Prefixe As Byte
Suffixe As Byte
End Type
Type ObjIdType ' Vision d'ObjectType alignée sur un Long = 4 Bytes = 32-bit
Value As Long
End Type
' Tableau de corrélation entre propriétés par objet et type de propriétés
Public arrObjRel(indObjFirst To indObjLast, indTypePropertyFirst To indTypePropertyLast, _
indPropertyFirst To nbrMaxProperties, indPropertyFirst To nbrMaxProperties) As Byte
' Nom de chaque propriétés
Public arrObjName(indObjFirst To indObjLast, indTypePropertyFirst To indTypePropertyLast, _
indPropertyFirst To nbrMaxProperties) As String
Public Const rankStockMax = 100 ' Nombre maximum d'objets dans le stock
Public arrStock(1 To rankStockMax) As Long ' array représentant le stock
Public nbrObjStock As Integer ' Nombre d'objets dans le stock
Public varNameObj As Variant ' Nom de chaque famille
Public objTarget As Long ' Cible à atteindre
Function MergeObject(ByVal obj1 As Long, ByVal obj2 As Long) As Long
End Function
Sub SearchTarget(ByVal indObjCible As Byte, ByVal indSuppCible As Byte, _
ByVal indPrefCible As Byte, ByVal indSuffCible As Byte)
Dim indRank As Integer
If Not IsObjOk(indObjCible, indSuppCible, indPrefCible, indSuffCible) Then Exit Sub
objTarget = IdObjFromProper(indObjCible, indSuppCible, indPrefCible, indSuffCible)
If IsObjInStock(objTarget) Then
Debug.Print "La cible est déjà dans le Stock": Exit Sub
End If
Debug.Print vbCrLf + "La cible à atteindre est : " + vbCrLf + ObjToString(objTarget)
End Sub
Sub MergeDo()
Dim result As Byte
result = MergeObject(indObjRing, indRingSuppAnneau, indRingPrefTitane, indRingSuffJouvence)
End Sub
' Initialisation du jeu
Sub InitRpg()
Dim indRow As Integer, indCol As Integer, rngCell As Range, rngName As Range
' Données Anneaux
InitObject indObjRing, indSupport, rowRingSuppStart, rowRingSuppEnd, nbrMaxRingSupp
InitObject indObjRing, indPrefixe, rowRingPrefStart, rowRingPrefEnd, nbrMaxRingPref
InitObject indObjRing, indSuffixe, rowRingSuffStart, rowRingSuffEnd, nbrMaxRingSuff
' Données Amulettes
InitObject indObjAmu, indSupport, rowAmuSuppStart, rowAmuSuppEnd, nbrMaxAmuSupp
InitObject indObjAmu, indPrefixe, rowAmuPrefStart, rowAmuPrefEnd, nbrMaxAmuPref
InitObject indObjAmu, indSuffixe, rowAmuSuffStart, rowAmuSuffEnd, nbrMaxAmuSuff
' Données Armes 1main
InitObject indObjCaC1H, indSupport, rowCaC1HSuppStart, rowCaC1HSuppEnd, nbrMaxCaC1HSupp
InitObject indObjCaC1H, indPrefixe, rowCaC1HPrefStart, rowCaC1HPrefEnd, nbrMaxCaC1HPref
InitObject indObjCaC1H, indSuffixe, rowCaC1HSuffStart, rowCaC1HSuffEnd, nbrMaxCaC1HSuff
' Données Armes 2mains
InitObject indObjCaC2H, indSupport, rowCaC2HSuppStart, rowCaC2HSuppEnd, nbrMaxCaC2HSupp
InitObject indObjCaC2H, indPrefixe, rowCaC2HPrefStart, rowCaC2HPrefEnd, nbrMaxCaC2HPref
InitObject indObjCaC2H, indSuffixe, rowCaC2HSuffStart, rowCaC2HSuffEnd, nbrMaxCaC2HSuff
' Données Casques
InitObject indObjHat, indSupport, rowHatSuppStart, rowHatSuppEnd, nbrMaxHatSupp
InitObject indObjHat, indPrefixe, rowHatPrefStart, rowHatPrefEnd, nbrMaxHatPref
InitObject indObjHat, indSuffixe, rowHatSuffStart, rowHatSuffEnd, nbrMaxHatSuff
' Données Pantalons
InitObject indObjPant, indSupport, rowPantSuppStart, rowPantSuppEnd, nbrMaxPantSupp
InitObject indObjPant, indPrefixe, rowPantPrefStart, rowPantPrefEnd, nbrMaxPantPref
InitObject indObjPant, indSuffixe, rowPantSuffStart, rowPantSuffEnd, nbrMaxPantSuff
' Données Armures
InitObject indObjArmor, indSupport, rowArmorSuppStart, rowArmorSuppEnd, nbrMaxArmorSupp
InitObject indObjArmor, indPrefixe, rowArmorPrefStart, rowArmorPrefEnd, nbrMaxArmorPref
InitObject indObjArmor, indSuffixe, rowArmorSuffStart, rowArmorSuffEnd, nbrMaxArmorSuff
' Données Armes à Distance
InitObject indObjAad, indSupport, rowAadSuppStart, rowAadSuppEnd, indAadSuppLast
InitObject indObjAad, indSuffixe, rowAadSuffStart, rowAadSuffEnd, indAadSuffLast
varNameObj = Array("Ring", "Amulettes", "Hand Gun1", "Hand Gun2", "Casques", "Pant", "Armor", "Distant Gun")
StockClear
StockInit ' pour test
Debug.Print "L'état du stock est : "
StockDisplay
SearchTarget indObjRing, indRingSuppAnneau, indRingPrefTitane, indRingSuffJouvence
End Sub
' Initialisation d'un objet
Sub InitObject(ByVal indObj As Byte, ByVal indType As Byte, _
ByVal indRowStart As Integer, ByVal indRowEnd As Integer, ByVal nbrMaxItem As Byte)
Dim indRow As Integer, indCol As Integer, varCell As Variant, varName As Variant
With Worksheets(nomFeuilleSrcDFusion) ' Lecture de tout le tableau en une seule fois dans un Variant
varCell = .Range(.Cells(indRowStart, colObjFirst), .Cells(indRowEnd, colObjFirst + nbrMaxItem - 1)).Value
varName = .Range(.Cells(indRowStart, colObjName), .Cells(indRowEnd, colObjName)).Value
End With
For indRow = indPropertyFirst To nbrMaxItem
For indCol = indPropertyFirst To nbrMaxItem ' Initialisation de la matrice de corrélation
arrObjRel(indObj, indType, indRow, indCol) = varCell(indRow, indCol)
Next
' Initialisation du nom d'une propriété
arrObjName(indObj, indType, indRow) = varName(indRow, 1)
Next
End Sub
' Les n° de propriétés de l'objet sont-ils valides ?
Function IsObjOk(ByVal indObj As Byte, ByVal indSupp As Byte, ByVal indPref As Byte, _
ByVal indSuff As Byte) As Boolean
IsObjOk = False
If indObj < indObjFirst Or indObj > indObjLast Then
Warning "1000: Objet " & indObj & " inconnu": Exit Function
End If
If Not IsIndexOk(indObj, indSupport, indSupp) Then
Warning "1100: Support " & indSupp & " inconnu": Exit Function
End If
If Not IsIndexOk(indObj, indPrefixe, indPref) Then
Warning "1100: Prefixe " & indPref & " inconnu": Exit Function
End If
If Not IsIndexOk(indObj, indSuffixe, indSuff) Then
Warning "1200: Suffixe " & indSuff & " inconnu": Exit Function
End If
IsObjOk = True
End Function
' Vérifie que l'indice de propriété d'un type donné dans un objet est valide
' Quand on ajoute un nouvel objet, il faut checker ses indices en ajoutant un : Case indObjName
Function IsIndexOk(ByVal indObj As Byte, ByVal typeProperty As Byte, ByVal indexProperty As Byte) As Boolean
IsIndexOk = False
If indexProperty < indPropertyFirst Then Exit Function
Select Case indObj
Case indObjRing
Select Case typeProperty
Case indSupport: If indexProperty > nbrMaxRingSupp Then Exit Function
Case indPrefixe: If indexProperty > nbrMaxRingPref Then Exit Function
Case indSuffixe: If indexProperty > nbrMaxRingSuff Then Exit Function
Case Else: Exit Function
End Select
Case indObjAmu
Select Case typeProperty
Case indSupport: If indexProperty > nbrMaxAmuSupp Then Exit Function
Case indPrefixe: If indexProperty > nbrMaxAmuPref Then Exit Function
Case indSuffixe: If indexProperty > nbrMaxAmuSuff Then Exit Function
Case Else: Exit Function
End Select
Case indObjCaC1H
Select Case typeProperty
Case indSupport: If indexProperty > nbrMaxCaC1HSupp Then Exit Function
Case indPrefixe: If indexProperty > nbrMaxCaC1HPref Then Exit Function
Case indSuffixe: If indexProperty > nbrMaxCaC1HSuff Then Exit Function
Case Else: Exit Function
End Select
Case indObjCaC2H
Select Case typeProperty
Case indSupport: If indexProperty > nbrMaxCaC2HSupp Then Exit Function
Case indPrefixe: If indexProperty > nbrMaxCaC2HPref Then Exit Function
Case indSuffixe: If indexProperty > nbrMaxCaC2HSuff Then Exit Function
Case Else: Exit Function
End Select
Case indObjHat
Select Case typeProperty
Case indSupport: If indexProperty > nbrMaxHatSupp Then Exit Function
Case indPrefixe: If indexProperty > nbrMaxHatPref Then Exit Function
Case indSuffixe: If indexProperty > nbrMaxHatSuff Then Exit Function
Case Else: Exit Function
End Select
Case indObjPant
Select Case typeProperty
Case indSupport: If indexProperty > nbrMaxPantSupp Then Exit Function
Case indPrefixe: If indexProperty > nbrMaxPantPref Then Exit Function
Case indSuffixe: If indexProperty > nbrMaxPantSuff Then Exit Function
Case Else: Exit Function
End Select
Case indObjArmor
Select Case typeProperty
Case indSupport: If indexProperty > nbrMaxArmorSupp Then Exit Function
Case indPrefixe: If indexProperty > nbrMaxArmorPref Then Exit Function
Case indSuffixe: If indexProperty > nbrMaxArmorSuff Then Exit Function
Case Else: Exit Function
End Select
Case indObjAad
Select Case typeProperty
Case indSupport: If indexProperty > indAadSuppLast Then Exit Function
Case indSuffixe: If indexProperty > indAadSuffLast Then Exit Function
Case Else: Exit Function
End Select
Case Else: Exit Function
End Select
IsIndexOk = True
End Function
' Nom d'un support d'un objet
Function SupportToString(ByVal indObj As Byte, ByVal indSupp As Byte) As String
If IsIndexOk(indObj, indSupport, indSupp) Then
SupportToString = arrObjName(indObj, indSupport, indSupp)
Else
SupportToString = vbNullString
End If
End Function
' Nom d'un préfixe d'un objet
Function PrefixeToString(ByVal indObj As Byte, ByVal indPref As Byte) As String
If IsIndexOk(indObj, indPrefixe, indPref) Then
PrefixeToString = arrObjName(indObj, indPrefixe, indPref)
Else
PrefixeToString = vbNullString
End If
End Function
' Nom d'un suffixe d'un objet
Function SuffixeToString(ByVal indObj As Byte, ByVal indSuff As Byte) As String
If IsIndexOk(indObj, indSuffixe, indSuff) Then
SuffixeToString = arrObjName(indObj, indSuffixe, indSuff)
Else
SuffixeToString = vbNullString
End If
End Function
' Relation entre supports
Function SupportRelation(ByVal indObj As Byte, ByVal indSupp1 As Byte, ByVal indSupp2 As Byte, _
Optional ByVal isCheckPrm As Boolean = True) As Byte
If isCheckPrm Then
SupportRelation = 0
If indSupp1 = indSupp2 Then Exit Function
If Not IsIndexOk(indObj, indSupport, indSupp1) Then Exit Function
If Not IsIndexOk(indObj, indSupport, indSupp2) Then Exit Function
End If
SupportRelation = arrObjRel(indObj, indSupport, indSupp1, indSupp2)
End Function
' Relation entre préfixes
Function PrefixeRelation(ByVal indObj As Byte, ByVal indPref1 As Byte, ByVal indPref2 As Byte, _
Optional ByVal isCheckPrm As Boolean = True) As Byte
If isCheckPrm Then
PrefixeRelation = 0
If indPref1 = indPref2 Then Exit Function
If Not IsIndexOk(indObj, indPrefixe, indPref1) Then Exit Function
If Not IsIndexOk(indObj, indPrefixe, indPref2) Then Exit Function
End If
PrefixeRelation = arrObjRel(indObj, indPrefixe, indPref1, indPref2)
End Function
' Relation entre suffixes
Function SuffixeRelation(ByVal indObj As Byte, ByVal indSuff1 As Byte, ByVal indSuff2 As Byte, _
Optional ByVal isCheckPrm As Boolean = True) As Byte
If isCheckPrm Then
SuffixeRelation = 0
If indSuff1 = indSuff2 Then Exit Function
If Not IsIndexOk(indObj, indSuffixe, indSuff1) Then Exit Function
If Not IsIndexOk(indObj, indSuffixe, indSuff2) Then Exit Function
End If
SuffixeRelation = arrObjRel(indObj, indSuffixe, indSuff1, indSuff2)
End Function
' Corrélation entre deux objets selon un type de propriété donnée. Résulat : propriété
Function Correlation(ByVal indObj As Byte, ByVal typeProperty As Byte, ByVal indexProperty1 As Byte, _
ByVal indexProperty2 As Byte, Optional ByVal isCheckPrm As Boolean = True) As Byte
If isCheckPrm Then
Correlation = 0
If indexProperty1 = indexProperty2 Then Exit Function
If Not IsIndexOk(indObj, typeProperty, indexProperty1) Then Exit Function
If Not IsIndexOk(indObj, typeProperty, indexProperty2) Then Exit Function
End If
Correlation = arrObjRel(indObj, typeProperty, indexProperty1, indexProperty2)
End Function
' Corrélation entre deux objets selon un type de propriété donnée. Résultat : chaîne de la propriété
Function CorrelationToString(ByVal indObj As Byte, ByVal typeProperty As Byte, _
ByVal indexProperty1 As Byte, ByVal indexProperty2 As Byte) As String
Dim indPropRel As Byte
indPropRel = Correlation(indObj, typeProperty, indexProperty1, indexProperty2)
If indPropRel > 0 Then
CorrelationToString = PropertyToString(indObj, typeProperty, indPropRel)
Else
CorrelationToString = vbNullString
End If
End Function
' Nom d'une propriété d'un objet d'un type donné
Function PropertyToString(ByVal indObj As Byte, ByVal typeProperty As Byte, ByVal indexProperty As Byte) As String
If IsIndexOk(indObj, typeProperty, indexProperty) Then
PropertyToString = arrObjName(indObj, typeProperty, indexProperty)
Else
PropertyToString = vbNullString
End If
End Function
' Retourne la chaîne de caractère de toutes les propriétés de l'objet identifié par son n°
Function ObjToString(ByVal idObjet As Long) As String
Const sepObj = ": ", sepPrm = ", "
Dim indObj As Byte, indSupp As Byte, indPref As Byte, indSuff As Byte
ProperFromIdObj idObjet, indObj, indSupp, indPref, indSuff
If IsObjOk(indObj, indSupp, indPref, indSuff) Then
ObjToString = varNameObj(indObj - 1) + sepObj + SupportToString(indObj, indSupp) + _
sepPrm + PrefixeToString(indObj, indPref) + sepPrm + SuffixeToString(indObj, indSuff)
Else
ObjToString = "L'objet n° " & idObjet & " est inconnu."
End If
End Function
' Convertir les propriétés de l'objet en un n° unique
Function IdObjFromProper(ByVal indObj As Byte, ByVal indSupp As Byte, _
ByVal indPref As Byte, ByVal indSuff As Byte) As Long
Dim objRpg As ObjectType, objId As ObjIdType
With objRpg
.Family = indObj
.Suppport = indSupp
.Prefixe = indPref
.Suffixe = indSuff
End With
LSet objId = objRpg
IdObjFromProper = objId.Value
End Function
' Convertir le n° unique de l'objet en ses propriétés
Sub ProperFromIdObj(ByVal idObjet As Long, ByRef indObj As Byte, ByRef indSupp As Byte, _
ByRef indPref As Byte, ByRef indSuff As Byte)
Dim objRpg As ObjectType, objId As ObjIdType
objId.Value = idObjet
LSet objRpg = objId
With objRpg
indObj = .Family
indSupp = .Suppport
indPref = .Prefixe
indSuff = .Suffixe
End With
End Sub
' L'objet de n° idObjet est-il dans le stock ?
Function IsObjInStock(ByVal idObjet As Long) As Boolean
Dim indRank As Integer
For indRank = 1 To nbrObjStock
If arrStock(indRank) = idObjet Then
IsObjInStock = True: Exit Function
End If
Next
IsObjInStock = False
End Function
' Initialisation du stock sans lire la feuille
Sub StockInit()
StockAdd indObjRing, indRingSuppAnneau, indRingPrefDiamant, indRingSuffDelit
StockAdd indObjRing, indRingSuppAnneau, indRingPrefDur, indRingSuffPeauDur
StockAdd indObjRing, indRingSuppAnneau, indRingPrefArgent, indRingSuffAstuce
StockAdd indObjRing, indRingSuppAnneau, indRingPrefPlatine, indRingSuffJustesse
StockAdd indObjRing, indRingSuppAnneau, indRingPrefDistingue, indRingSuffArt
StockAdd indObjRing, indRingSuppAnneau, indRingPrefArgent, indRingSuffSagesse
StockAdd indObjRing, indRingSuppBracelet, indRingPrefAstral, indRingSuffSagesse
StockAdd indObjRing, indRingSuppBracelet, indRingPrefBronze, indRingSuffSagesse
StockAdd indObjRing, indRingSuppBracelet, indRingPrefBronze, indRingSuffPeauDur
StockAdd indObjRing, indRingSuppChevaliere, indRingPrefBronze, indRingSuffGenie
StockAdd indObjRing, indRingSuppChevaliere, indRingPrefOr, indRingSuffSagesse
End Sub
Function StockAdd(ByVal indObj As Byte, ByVal indSupp As Byte, ByVal indPref As Byte, _
ByVal indSuff As Byte) As Boolean
Dim idObjet As Long
StockAdd = False
If nbrObjStock > rankStockMax Then Warning "2000: Trop d'objets": Exit Function
If Not IsObjOk(indObj, indSupp, indPref, indSuff) Then Exit Function
idObjet = IdObjFromProper(indObj, indSupp, indPref, indSuff)
If IsObjInStock(idObjet) Then Warning "2100: objet déjà en stock": Exit Function
nbrObjStock = nbrObjStock + 1
arrStock(nbrObjStock) = idObjet
StockAdd = True
End Function
Sub StockClear()
Erase arrStock
nbrObjStock = 0
End Sub
Sub StockDelLast()
If nbrObjStock > 0 Then
nbrObjStock = nbrObjStock - 1
End If
If nbrObjStock = 0 Then
StockClear
End If
End Sub
Sub StockDisplay()
Dim indRank As Integer
Dim indObj As Byte, indSupp As Byte, indPref As Byte, indSuff As Byte
If nbrObjStock = 0 Then Debug.Print "Le stock est vide"
For indRank = 1 To nbrObjStock
Debug.Print Format(indRank, "00 ") + ObjToString(arrStock(indRank))
Next
End Sub
Sub Warning(ByVal strMsg As String) 'Common error management
Const lenErr = 4 ' Number of digits of the error code beginning the message
If Err.Number <> 0 Then
strMsg = strMsg + vbCrLf + "Error " + Str(Err.Number) + ": " + Err.Description
End If
MsgBox Mid(strMsg, lenErr + 3), vbExclamation, "Fusion warning " + Left(strMsg, lenErr)
End Sub |
Partager