@@ -49,17 +49,17 @@ defmodule Galaxies.Accounts do
49
49
preload: :research
50
50
)
51
51
52
- if player_research . current_level == level - 1 do
52
+ if player_research . level == level - 1 do
53
53
{ :ok , _ } =
54
54
Repo . update (
55
55
PlayerResearch . upgrade_changeset ( player_research , % {
56
- current_level : level
56
+ level : level
57
57
} )
58
58
)
59
59
60
60
{ :ok , player_research }
61
61
else
62
- { :error , "Cannot upgrade from level #{ player_research . current_level } to #{ level } " }
62
+ { :error , "Cannot upgrade from level #{ player_research . level } to #{ level } " }
63
63
end
64
64
end )
65
65
|> Ecto.Multi . run ( :update_planet , fn repo , % { player_research: player_research } ->
@@ -205,7 +205,7 @@ defmodule Galaxies.Accounts do
205
205
% {
206
206
player_id: player . id ,
207
207
research_id: research . id ,
208
- current_level : 0 ,
208
+ level : 0 ,
209
209
inserted_at: now ,
210
210
updated_at: now
211
211
}
@@ -234,7 +234,11 @@ defmodule Galaxies.Accounts do
234
234
image_id: 1 ,
235
235
metal_units: 5_000.0 ,
236
236
crystal_units: 5_000.0 ,
237
- deuterium_units: 500.0
237
+ deuterium_units: 500.0 ,
238
+ total_energy: 0 ,
239
+ available_energy: 0 ,
240
+ total_fields: 250 ,
241
+ used_fields: 0
238
242
} )
239
243
end )
240
244
|> Ecto.Multi . run ( :planet_buildings , fn repo , % { player: player , planet: planet } ->
@@ -244,7 +248,7 @@ defmodule Galaxies.Accounts do
244
248
% {
245
249
planet_id: planet . id ,
246
250
building_id: building . id ,
247
- current_level : 0 ,
251
+ level : 0 ,
248
252
inserted_at: now ,
249
253
updated_at: now
250
254
}
@@ -532,7 +536,7 @@ defmodule Galaxies.Accounts do
532
536
description_short: building . short_description ,
533
537
description_long: building . long_description ,
534
538
image_src: building . image_src ,
535
- current_level : planet_building . current_level ,
539
+ level : planet_building . level ,
536
540
upgrade_cost_formula: building . upgrade_cost_formula
537
541
} ,
538
542
order_by: [ building . list_order ]
@@ -556,7 +560,7 @@ defmodule Galaxies.Accounts do
556
560
description_short: building . short_description ,
557
561
description_long: building . long_description ,
558
562
image_src: building . image_src ,
559
- current_level : planet_building . current_level ,
563
+ level : planet_building . level ,
560
564
upgrade_cost_formula: building . upgrade_cost_formula
561
565
} ,
562
566
order_by: [ building . list_order ]
@@ -579,7 +583,7 @@ defmodule Galaxies.Accounts do
579
583
description_short: research . short_description ,
580
584
description_long: research . long_description ,
581
585
image_src: research . image_src ,
582
- current_level : player_research . current_level ,
586
+ level : player_research . level ,
583
587
upgrade_cost_formula: research . upgrade_cost_formula ,
584
588
is_upgrading: player_research . is_upgrading ,
585
589
upgrade_finished_at: player_research . upgrade_finished_at
0 commit comments