Ajout des mutations Sauveteuse, Adaptative et résistante, ajout des crédits du jeu et d'un splash screen (+ un peu de debug)
This commit is contained in:
@@ -131,11 +131,9 @@ func harvest():
|
||||
if do_produce_seeds:
|
||||
for i in range(data.get_seed_number()):
|
||||
await produce_seed()
|
||||
|
||||
if data.get_state() == PlantData.State.MATURE:
|
||||
for m in data.mutations:
|
||||
m._start_harvested_effect(self)
|
||||
|
||||
harvested = true
|
||||
|
||||
plant_sprite.start_harvest_animation()
|
||||
|
||||
@@ -17,6 +17,7 @@ enum State {PLANTED, GROWING, MATURE, DEAD}
|
||||
|
||||
var decontamination_area_factor = 0.
|
||||
var nearby_plants : Array[PlantData]
|
||||
var region_data : RegionData
|
||||
|
||||
func _init(
|
||||
_position: Vector2 = Vector2.ZERO,
|
||||
@@ -149,7 +150,14 @@ func get_score_buff() -> int:
|
||||
buff = m.mutate_score_buff(self, buff)
|
||||
|
||||
return buff
|
||||
|
||||
func get_mutation_probability_boost() -> float:
|
||||
var boost = 0
|
||||
|
||||
for m in mutations:
|
||||
boost = m.mutate_mutation_probability_boost(self, boost)
|
||||
|
||||
return boost
|
||||
|
||||
func disappear():
|
||||
disappeared.emit(self )
|
||||
|
||||
@@ -18,6 +18,9 @@ func get_icon() -> Texture:
|
||||
func get_base_rarity() -> int:
|
||||
return 0
|
||||
|
||||
func get_max_rarity() -> int:
|
||||
return MAX_RARITY
|
||||
|
||||
@abstract func get_mutation_id() -> String
|
||||
|
||||
func get_mutation_name() -> String:
|
||||
@@ -31,6 +34,9 @@ func mutate_plant_data(_plant_data: PlantData):
|
||||
func nullify_score(_plant_data: PlantData) -> bool:
|
||||
return false
|
||||
|
||||
func allow_planting_on_decontamined_terrain(_seed : Seed) -> bool:
|
||||
return false
|
||||
|
||||
func mutate_score(_plant_data: PlantData, score: int) -> int:
|
||||
return score
|
||||
|
||||
@@ -61,6 +67,9 @@ func mutate_seed_buff(_plant_data: PlantData, seed_buff : int) -> int:
|
||||
func mutate_score_buff(_plant_data: PlantData, score_buff : int) -> int:
|
||||
return score_buff
|
||||
|
||||
func mutate_mutation_probability_boost(_plant_data: PlantData, mutation_probability_boost : int) -> float:
|
||||
return mutation_probability_boost
|
||||
|
||||
func _start_planted_effect(_plant: Plant):
|
||||
pass
|
||||
|
||||
@@ -83,7 +92,7 @@ func get_rarity() -> int:
|
||||
return get_base_rarity() + level - 1
|
||||
|
||||
func is_max_level() -> bool:
|
||||
return get_base_rarity() + level < MAX_RARITY
|
||||
return get_base_rarity() + level < get_max_rarity()
|
||||
|
||||
func card_info() -> CardInfo:
|
||||
var info = CardInfo.new(
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
extends PlantMutation
|
||||
class_name AdaptiveMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/dna.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "ADAPTIVE"
|
||||
|
||||
func get_base_rarity() -> int:
|
||||
return 0
|
||||
|
||||
func get_mutation_description() -> String:
|
||||
return tr("ADAPTIVE_EFFECT_TEXT").format({
|
||||
"mutation_probability_boost": get_mutation_probability_boost(),
|
||||
})
|
||||
|
||||
func get_mutation_probability_boost()->float:
|
||||
return level * 0.05
|
||||
@@ -0,0 +1 @@
|
||||
uid://blwkliqwgqs32
|
||||
@@ -21,5 +21,5 @@ func mutate_score_multiplier(plant_data: PlantData, multiplier: float) -> float:
|
||||
return multiplier + get_score_multiplier()
|
||||
return multiplier
|
||||
|
||||
func get_score_multiplier()->int:
|
||||
return level
|
||||
func get_score_multiplier()->float:
|
||||
return 0.5 * level
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
extends PlantMutation
|
||||
class_name ResistantMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/radioactive.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "RESISTANT"
|
||||
|
||||
func get_base_rarity() -> int:
|
||||
return 0
|
||||
|
||||
func get_mutation_description() -> String:
|
||||
return tr("RESISTANT_EFFECT_TEXT")
|
||||
|
||||
func is_max_level() -> bool:
|
||||
return true
|
||||
|
||||
func allow_planting_on_decontamined_terrain(_seed : Seed) -> bool:
|
||||
return true
|
||||
@@ -0,0 +1 @@
|
||||
uid://dfuknjnoo1fp8
|
||||
@@ -0,0 +1,25 @@
|
||||
extends PlantMutation
|
||||
class_name SaviorMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/lifebuoy.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "SAVIOR"
|
||||
|
||||
func get_base_rarity() -> int:
|
||||
return 0
|
||||
|
||||
func get_mutation_description() -> String:
|
||||
return tr("SAVIOR_EFFECT_TEXT").format({
|
||||
"score_icon": Text.bbcode_icon(Plant.SCORE_ICON),
|
||||
"score_multiplier": get_score_multiplier() + 1,
|
||||
})
|
||||
|
||||
func mutate_score_multiplier(plant_data: PlantData, multiplier: float) -> float:
|
||||
if plant_data.region_data and plant_data.region_data.charges == 0:
|
||||
return multiplier + get_score_multiplier()
|
||||
return multiplier
|
||||
|
||||
func get_score_multiplier()->float:
|
||||
return 0.5 * level
|
||||
@@ -0,0 +1 @@
|
||||
uid://dn1qruq8wu8y7
|
||||
@@ -5,7 +5,7 @@ func get_icon() -> Texture:
|
||||
return preload("res://common/icons/sparkles.svg")
|
||||
|
||||
func get_base_rarity() -> int:
|
||||
return 0
|
||||
return 1
|
||||
|
||||
func is_max_level() -> bool:
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user