feat(politics): add new political office benefits and enhance database migration
All checks were successful
Deploy to production / deploy (push) Successful in 2m54s
All checks were successful
Deploy to production / deploy (push) Successful in 2m54s
- Introduced new benefits including 'reputation_periodic', 'appoint_politicians', 'set_regional_tax', 'free_lover_slots', 'guard_protection', and 'court_immunity' to the political office system. - Updated database migration to add and remove the 'last_political_daily_salary_on' column using SQL queries for better performance. - Enhanced localization files for multiple languages to support new benefits, improving user experience across the application. - Updated UI components to display new benefits correctly in the PoliticsView, ensuring accurate representation of political office functionalities.
This commit is contained in:
@@ -6101,6 +6101,25 @@ class FalukantService extends BaseService {
|
||||
if (amount > 0) {
|
||||
out.push({ tr: 'daily_salary', params: { amount } });
|
||||
}
|
||||
} else if (tr === 'reputation_periodic' || (tr === 'reputation' && (v.intervalDays != null || v.everyDays != null))) {
|
||||
const intervalDays = Math.max(1, Number(v.intervalDays ?? v.everyDays ?? 7));
|
||||
const gain = Math.max(1, Number(v.gain ?? v.reputationGain ?? 1));
|
||||
out.push({ tr: 'reputation_periodic', params: { intervalDays, gain } });
|
||||
} else if (tr === 'appoint_politicians' || (tr === 'influence' && Array.isArray(v.officeTrs) && v.officeTrs.length)) {
|
||||
const officeTrs = Array.isArray(v.officeTrs) ? v.officeTrs.filter((x) => typeof x === 'string') : [];
|
||||
if (officeTrs.length) {
|
||||
out.push({ tr: 'appoint_politicians', params: { officeTrs } });
|
||||
}
|
||||
} else if (tr === 'set_regional_tax' || tr === 'set_regionl_tax') {
|
||||
const scope = typeof v.scope === 'string' && v.scope ? v.scope : 'local';
|
||||
out.push({ tr: 'set_regional_tax', params: { scope } });
|
||||
} else if (tr === 'free_lover_slots') {
|
||||
const count = Math.max(1, Number(v.count ?? 1));
|
||||
out.push({ tr: 'free_lover_slots', params: { count } });
|
||||
} else if (tr === 'guard_protection') {
|
||||
out.push({ tr: 'guard_protection', params: {} });
|
||||
} else if (tr === 'court_immunity') {
|
||||
out.push({ tr: 'court_immunity', params: {} });
|
||||
} else if (tr) {
|
||||
out.push({ tr: 'generic_benefit', params: { code: tr } });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user