|
57 | 57 | },
|
58 | 58 | compatibility = pydwarf.df_0_40
|
59 | 59 | )
|
60 |
| -def trans(dfraws, species=default_species, beards=True, frequency=500): |
| 60 | +def trans(df, species=default_species, beards=True, frequency=500): |
61 | 61 | # Add new interaction
|
62 |
| - pydwarf.log.debug('Adding sterility interaction...') |
63 |
| - objinteraction = dfraws.get('OBJECT:INTERACTION') |
64 |
| - if objinteraction: |
65 |
| - objinteraction.add(pretty=add_sterile_interaction) |
| 62 | + response = pydwarf.scripts.pineapple.utils.addobject( |
| 63 | + df, |
| 64 | + add_to_file = 'raw/objects/smeeprocket_transgender_interaction.txt', |
| 65 | + tokens = add_sterile_interaction |
| 66 | + ) |
| 67 | + if response: |
| 68 | + pydwarf.log.debug('Added sterility interaction.') |
66 | 69 | else:
|
67 | 70 | return pydwarf.failure('Unable to add sterility interaction.')
|
68 | 71 |
|
69 | 72 | # Add new castes
|
70 | 73 | castefailures = []
|
71 |
| - creaturetokens = dfraws.allobj(type='CREATURE', id_in=species) |
| 74 | + creaturetokens = df.allobj(type='CREATURE', id_in=species) |
72 | 75 | for creaturetoken in creaturetokens:
|
73 | 76 | pydwarf.log.debug('Handling creature %s...' % creaturetoken)
|
74 | 77 |
|
75 | 78 | castes = creaturetoken.allprop(exact_value='CASTE', args_count=1)
|
76 |
| - if len(castes) == 2 and ((castes[0].args[0] == 'MALE' and castes[1].args[0] == 'FEMALE') or (castes[1].args[0] == 'MALE' and castes[0].args[0] == 'FEMALE')): |
| 79 | + if( |
| 80 | + len(castes) == 2 and ( |
| 81 | + (castes[0].args[0] == 'MALE' and castes[1].args[0] == 'FEMALE') or |
| 82 | + (castes[1].args[0] == 'MALE' and castes[0].args[0] == 'FEMALE') |
| 83 | + ) |
| 84 | + ): |
77 | 85 |
|
78 | 86 | # Remove DESCRIPTION token from the creature and add it to each caste
|
79 | 87 | descriptiontoken = creaturetoken.get(exact_value='DESCRIPTION', args_count=1)
|
|
0 commit comments