Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pyc
*.swp
build/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ Senile Gwynevere: If active, the Lordvessel will be shuffled like other key item

Senile Primordial Serpents: If active, the four Lord Souls will be shuffled like other key items. Not compatible with not shuffling keys.

Eager Smiths: If active, weapons capable of upgrading along the various ember paths (Chaos, Magic, Divine, etc.) have a 25% chance of dropping as a +0 version of one of these paths. A bit of an easier setting, but will allow for more diversity of viable weapons across playthroughs.


**Race Mode Possible Key Locations**:

Expand Down
Binary file modified dist/DarkSoulsItemRandomizer.exe
Binary file not shown.
12 changes: 12 additions & 0 deletions dist/randomizer.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[DEFAULT]
difficulty = 0
fashion_souls = True
key_placement = 2
use_lordvessel = True
use_lord_souls = True
soul_items_diff = 2
start_items_diff = 2
game_version = DARK SOULS: Prepare To Die Edition
randomize_npc_armor = True
ascend_weapons = True

37 changes: 37 additions & 0 deletions ini_parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import configparser

def get_values_from_ini(ini_file, section="DEFAULT"):
config = configparser.ConfigParser()
config.read(ini_file)

if section in config: #check if section in ini
return config[section]
else:
return config["DEFAULT"]

def save_ini(ini_file, options):
config = configparser.ConfigParser()
for k,v in vars(options).items():
config["DEFAULT"][k] = str(v) #values must be strings to write

with open(ini_file, 'w') as configfile:
config.write(configfile)

def get_option_value(config, k):
"""
The following parses the values in the ini to produce the option list in the correct format
While I could create a separate list/dict to specify the typing of the data coming in
or by creating a section in the inifile for the typing
This would add extra work to the developer who adds new features which I think is far more annoying
So instead we get this ugly mess of try/excepts to get the typing we actually care about: int -> bool -> string
TODO: Allow type to be specified when calling (not really important at all)
"""
try:
option = config.getint(k, 0)
except ValueError:
try:
option = config.getboolean(k, False)
except ValueError:
option = config.get(k, "No Default Value")

return option
111 changes: 111 additions & 0 deletions items_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2074,3 +2074,114 @@ def boss_weapon_list_helper(min_index, max_index):
710: [boss_weapon_list_helper(9012000, 9012800) + boss_weapon_list_helper(9013000 , 9013700)],
711: [boss_weapon_list_helper(9017000, 9017500)],
}

ASCENDABLE_WEAPONS = {
100000: ("Dagger", True),
101000: ("Parrying Dagger", True),
103000: ("Bandit's Knife", True),
200000: ("Shortsword", True),
201000: ("Longsword", True),
202000: ("Broadsword", True),
203000: ("Broken Straight Sword", True),
204000: ("Balder Side Sword", True),
206000: ("Sunlight Straight Sword", True),
207000: ("Barbed Straight Sword", True),
209000: ("Astora's Straight Sword", True),
210000: ("Darksword", True),
212000: ("Straight Sword Hilt", True),
300000: ("Bastard Sword", True),
302000: ("Man-serpent Greatsword", True),
303000: ("Flamberge", True),
350000: ("Zweihander", True),
351000: ("Greatsword", True),
352000: ("Demon Great Machete", True),
400000: ("Scimitar", True),
401000: ("Falchion", True),
402000: ("Shotel", True),
405000: ("Painting Guardian Sword", True),
450000: ("Server", True),
451000: ("Murakumo", True),
500000: ("Uchigatana", True),
501000: ("Washing Pole", True),
502000: ("Iaito", True),
600000: ("Mail Breaker", True),
601000: ("Rapier", True),
602000: ("Estoc", True),
604000: ("Ricard's Rapier", True),
700000: ("Hand Axe", True),
701000: ("Battle Axe", True),
702000: ("Crescent Axe", True),
703000: ("Butcher Knife", True),
705000: ("Gargoyle Tail Axe", True),
750000: ("Greataxe", True),
751000: ("Demon's Greataxe", True),
800000: ("Club", True),
801000: ("Mace", True),
802000: ("Morning Star", True),
803000: ("Warpick", True),
804000: ("Pickaxe", True),
809000: ("Reinforced Club", True),
810000: ("Blacksmith Hammer", True),
811000: ("Blacksmith Giant Hammer", True),
812000: ("Hammer of Vamos", True),
850000: ("Great Club", True),
852000: ("Demon's Great Hammer", True),
855000: ("Large Club", True),
901000: ("Caestus", True),
902000: ("Claw", True),
1000000: ("Spear", True),
1001000: ("Winged Spear", True),
1002000: ("Partizan", True),
1004000: ("Channeler's Trident", True),
1050000: ("Pike", True),
1100000: ("Halberd", True),
1103000: ("Gargoyle's Halberd", True),
1106000: ("Lucerne", True),
1107000: ("Scythe", True),
1150000: ("Great Scythe", True),
1200000: ("Short Bow", True),
1201000: ("Longbow", True),
1202000: ("Black Bow of Pharis", True),
1204000: ("Composite Bow", True),
1250000: ("Light Crossbow", False),
1251000: ("Heavy Crossbow", False),
1252000: ("Avelyn", False),
1253000: ("Sniper Crossbow", False),
1400000: ("East-West Shield", False),
1401000: ("Wooden Shield", False),
1402000: ("Large Leather Shield", False),
1403000: ("Small Leather Shield", False),
1404000: ("Target Shield", False),
1405000: ("Buckler", False),
1406000: ("Cracked Round Shield", False),
1408000: ("Leather Shield", False),
1409000: ("Plank Shield", False),
1410000: ("Caduceus Round Shield", False),
1450000: ("Heater Shield", False),
1451000: ("Knight Shield", False),
1452000: ("Tower Kite Shield", False),
1453000: ("Grass Crest Shield", False),
1454000: ("Hollow Soldier Shield", False),
1455000: ("Balder Shield", False),
1460000: ("Warrior's Round Shield", False),
1461000: ("Iron Round Shield", False),
1462000: ("Spider Shield", False),
1470000: ("Spiked Shield", False),
1472000: ("Sunlight Shield", False),
1475000: ("Pierce Shield", False),
1476000: ("Red and White Round Shield", False),
1477000: ("Caduceus Kite Shield", False),
1478000: ("Gargoyle's Shield", False),
1500000: ("Eagle Shield", False),
1501000: ("Tower Shield", False),
1502000: ("Giant Shield", False),
1506000: ("Bonewheel Shield", False),
1600000: ("Whip", True),
1601000: ("Notched Whip", True),
9000000: ("Effigy Shield", False),
9001000: ("Sanctus", False),
9002000: ("Bloodshield", False),
9003000: ("Black Iron Greatshield", False),
9016000: ("Four-pronged Plow", True),
9019000: ("Guardian Tail", True)
}
20 changes: 20 additions & 0 deletions randomize_item_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,22 @@ def transmute_itemlotpart_to_boss_item(itemlotpart, random_source):
log.debug("Transmuting itemlotpart into boss item (" + str(boss_item_type) + ", " +
str(boss_item_id) + ")")
return itemlotpart

def ascend_itemlotpart_to_ascended_item(itemlotpart, random_source):
if itemlotpart.items:
for itemlotentry in itemlotpart.items:
if itemlotentry.item_type == item_s.ITEM_TYPE.WEAPON and \
itemlotentry.item_id in item_s.ASCENDABLE_WEAPONS:
if random_source.random() < .25:
entry = item_s.ASCENDABLE_WEAPONS[itemlotentry.item_id]
if entry[1] == True:
add = random_source.choice([1,2,3,4,5,6,7,8,9])
else:
add = random_source.choice([1,2,4,6,8])
itemlotentry.item_id = itemlotentry.item_id + (add * 100)
log.debug("Ascending itemlotpart into ascended weapon (" +
str(itemlotentry.item_id) + ")")
return itemlotpart

def place_ignored_items(table, item_list):
log.info("Placing ignored items.")
Expand Down Expand Up @@ -336,6 +352,10 @@ def place_non_key_fixed_items(table, rand_options, random_source, item_list):
if item.diff in [item_s.ITEM_DIF.SALABLE_EASY, item_s.ITEM_DIF.SALABLE_MEDIUM,
item_s.ITEM_DIF.SALABLE_HARD]:
item.items[0].count = -1

# Optionally randomly ascend weapons.
if rand_options.ascend_weapons == True:
item = ascend_itemlotpart_to_ascended_item(item, random_source)

# Place item.
possible_loc_ids = create_random_placement_list(table,
Expand Down
12 changes: 12 additions & 0 deletions randomizer.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[DEFAULT]
difficulty = 0
fashion_souls = True
key_placement = 2
use_lordvessel = True
use_lord_souls = True
soul_items_diff = 2
start_items_diff = 2
game_version = DARK SOULS: Prepare To Die Edition
randomize_npc_armor = True
ascend_weapons = True

Loading