|
1 | | -// <copyright file="Program.cs" company="Windower Team"> |
| 1 | +// <copyright file="Program.cs" company="Windower Team"> |
2 | 2 | // Copyright © 2013-2018 Windower Team |
3 | 3 | // |
4 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy |
@@ -350,6 +350,75 @@ private static void PostProcess() |
350 | 350 |
|
351 | 351 | model.item_descriptions.Add(item_description); |
352 | 352 | } |
| 353 | + |
| 354 | + const uint ammo_slot = 8; |
| 355 | + const uint cor_job_flag = (1 << 17); |
| 356 | + IReadOnlyDictionary<uint, string> range_slot_skills = new Dictionary<uint, string> |
| 357 | + { |
| 358 | + {25,"Archery"}, |
| 359 | + {26,"Marksmanship"}, |
| 360 | + {48,"Fishing"} |
| 361 | + }; |
| 362 | + foreach (var item in model.items) |
| 363 | + { |
| 364 | + if (!item.ContainsKey("slots") || !item.ContainsKey("skill") || !range_slot_skills.ContainsKey(item.skill)) continue; |
| 365 | + string skill = range_slot_skills[item.skill]; |
| 366 | + bool ammo = item.slots == ammo_slot; |
| 367 | + if (skill == "Archery") |
| 368 | + { |
| 369 | + if (ammo) |
| 370 | + { |
| 371 | + item.ammo_type = "Arrow"; |
| 372 | + } |
| 373 | + else |
| 374 | + { |
| 375 | + item.range_type = "Bow"; |
| 376 | + } |
| 377 | + } |
| 378 | + else if (skill == "Marksmanship") |
| 379 | + { |
| 380 | + if (ammo) |
| 381 | + { |
| 382 | + if (item.ja.Contains("ブレット") || item.en.Contains("Bullet")) |
| 383 | + { |
| 384 | + item.ammo_type = "Bullet"; |
| 385 | + } |
| 386 | + else if (item.ja.Contains("シェル") || item.en.Contains("Shell")) |
| 387 | + { |
| 388 | + item.ammo_type = "Shell"; |
| 389 | + } |
| 390 | + else if (item.ja.Contains("ボルト") || item.en.Contains("Bolt")) |
| 391 | + { |
| 392 | + item.ammo_type = "Bolt"; |
| 393 | + } |
| 394 | + } |
| 395 | + else { |
| 396 | + if (item.delay >= 700 && item.delay < 999) |
| 397 | + { |
| 398 | + item.range_type = "Cannon"; |
| 399 | + } |
| 400 | + else if (item.delay > 450 || (item.jobs & cor_job_flag) == cor_job_flag) |
| 401 | + { |
| 402 | + item.range_type = "Gun"; |
| 403 | + } |
| 404 | + else |
| 405 | + { |
| 406 | + item.range_type = "Crossbow"; |
| 407 | + } |
| 408 | + } |
| 409 | + } |
| 410 | + else if (skill == "Fishing") |
| 411 | + { |
| 412 | + if (ammo) |
| 413 | + { |
| 414 | + item.ammo_type = "Bait"; |
| 415 | + } |
| 416 | + else |
| 417 | + { |
| 418 | + item.range_type = "Fishing Rod"; |
| 419 | + } |
| 420 | + } |
| 421 | + } |
353 | 422 |
|
354 | 423 | // Move item grammar into separate table |
355 | 424 | model.items_grammar = new List<dynamic>(); |
|
0 commit comments