Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Civilizations improvements #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gvrettos
Copy link

@gvrettos gvrettos commented Feb 4, 2024

Hello. I have made some improvements mostly on the civilizations part:

  • some cleanup
  • added a missing civilization (Malay) and information about its unique unit from Rise of Rajas expansion

I have also update the database file, so tests continue to work.

For the database to be updated I had to deactivate the foreign keys and then enable them again in the end.
Here is the sequence of SQL scripts I have run against db in order to update it:

// Check if foreign key constraints are valid; they were not
PRAGMA foreign_key_check;
// Check the status of the foreign key constraints (1->ON / 0->OFF) 
PRAGMA foreign_keys; 
// Disable the foreign key constraints to avoid errors during updates
PRAGMA foreign_keys = OFF; 

// Delete duplicate entry for Goths
delete 
from civilizations
where _id=22;

// Delete duplicate entry for Japanese
delete 
from civilizations
where _id=26;

// Update units
insert into units(
	name, description, expansion, age, created_in, cost, 
	build_time, reload_time, movement_rate, line_of_sight, hit_points, range, attack, armor, attack_bonus
)
values(
	'Karambit Warrior', 'Malay unique unit. Cheap and weak infantry unit that only takes half a population slot', 'Rise of Rajas', 'Castle', 'Castle', '{"Food": 30;"Gold": 15}', 
	6, 2, 1.2, 5, 30, 0, 7, '0/1','+2 eagle warrior' 
);

insert into units(
	name, description, expansion, age, created_in, cost, 
	build_time, reload_time, movement_rate, line_of_sight, hit_points, range, attack, armor, attack_bonus
)
values(
	'Elite Karambit Warrior', ' Upgraded Karambit Warrior', 'Rise of Rajas', 'Imperial', 'Castle', '{"Food": 30;"Gold": 15}', 
	6, 2, 1.2, 5, 40, 0, 8, '1/1','+2 eagle warrior;+1 standard building'
);


// Here I should have normally updated technologies as well (with infor about Thalassocracy and Forced Levy), but there was no information in this file other than from "Age of Kings" and "The Conquerors". I decided to follow the existing pattern and leave it as it is.


// Update civilizations
insert into civilizations(name, expansion, army_type, unique_unit, unique_tech, team_bonus, civilization_bonus)
values('Malay', 'Rise of Rajas', 'Naval', 'Karambit Warrior', 'Thalassocracy;Forced Levy', 
'Advancing to ages 80% faster;Fish Traps cost 33% cheaper;Fish Traps provide unlimited food;Battle Elephants 30% cheaper', 'Docks +100% LOS');


// Activate foreign key constraints back again
PRAGMA foreign_keys = ON;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant