ajout de la porte et équilibrage des mutations
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
extends PlantMutation
|
||||
class_name AncientMutation
|
||||
|
||||
const DEFAULT_DAY_FACTOR = 3
|
||||
const DEFAULT_DAY_FACTOR = 4
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/wood.svg")
|
||||
|
||||
func get_base_rarity() -> int:
|
||||
return 0
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "ANCIENT"
|
||||
|
||||
@@ -16,10 +13,18 @@ func get_mutation_name() -> String:
|
||||
return tr("ANCIENT")
|
||||
|
||||
func get_mutation_description() -> String:
|
||||
return tr("ANCIENT_EFFECT_TEXT_LEVEL_%d") % get_day_factor()
|
||||
return tr("ANCIENT_EFFECT_TEXT_LEVEL").format(
|
||||
{
|
||||
"score_increase": get_score_increase(),
|
||||
"day_factor": get_day_factor()
|
||||
}
|
||||
)
|
||||
|
||||
func get_day_factor():
|
||||
return max(1, DEFAULT_DAY_FACTOR - level + 1)
|
||||
return max(1, DEFAULT_DAY_FACTOR - level)
|
||||
|
||||
func get_score_increase():
|
||||
return max(1, level - DEFAULT_DAY_FACTOR)
|
||||
|
||||
func mutate_score(data : PlantData, score) -> int:
|
||||
if data.get_state() != PlantData.State.MATURE:
|
||||
|
||||
@@ -2,10 +2,7 @@ extends PlantMutation
|
||||
class_name EphemeralMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/chevrons-up.svg")
|
||||
|
||||
func get_base_rarity() -> int:
|
||||
return 0
|
||||
return preload("res://common/icons/butterfly.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "EPHEMERAL"
|
||||
@@ -17,7 +14,7 @@ func get_mutation_description() -> String:
|
||||
return tr("EPHEMERAL_EFFECT_TEXT_LEVEL").format({"seed_number": level, "lifetime_change": get_lifetime_change()})
|
||||
|
||||
func mutate_lifetime(_plant_data: PlantData, lifetime: int) -> int:
|
||||
return lifetime - get_lifetime_change()
|
||||
return lifetime + get_lifetime_change()
|
||||
|
||||
func mutate_seed_number(_plant_data: PlantData, seed_number: int):
|
||||
return seed_number + level
|
||||
@@ -26,4 +23,4 @@ func get_seed_increase() -> int:
|
||||
return floori((level + 1.0) / 2)
|
||||
|
||||
func get_lifetime_change() -> int:
|
||||
return maxi(0, 6 - get_seed_increase())
|
||||
return -2
|
||||
|
||||
@@ -2,10 +2,7 @@ extends PlantMutation
|
||||
class_name FertileMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/chevrons-up.svg")
|
||||
|
||||
func get_base_rarity() -> int:
|
||||
return 0
|
||||
return preload("res://common/icons/seedling.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "FERTILE"
|
||||
@@ -16,6 +13,5 @@ func get_mutation_name() -> String:
|
||||
func get_mutation_description() -> String:
|
||||
return tr("FERTILE_EFFECT_TEXT_LEVEL_%d") % level
|
||||
|
||||
func mutate_lifetime(_plant_data : PlantData, lifetime : int) -> int:
|
||||
print("TODO:: Implemnt FERTILE lifetime based on plants around")
|
||||
return lifetime + level
|
||||
func mutate_seed_buff(_plant_data: PlantData) -> int:
|
||||
return level
|
||||
|
||||
@@ -2,10 +2,7 @@ extends PlantMutation
|
||||
class_name PrecociousMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/hourglass-empty.svg")
|
||||
|
||||
func get_base_rarity() -> int:
|
||||
return 0
|
||||
return preload("res://common/icons/rocket.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "PRECOCIOUS"
|
||||
|
||||
@@ -2,10 +2,7 @@ extends PlantMutation
|
||||
class_name PurificationMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/chevrons-up.svg")
|
||||
|
||||
func get_base_rarity() -> int:
|
||||
return 0
|
||||
return preload("res://common/icons/droplet.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "PURIFICATION"
|
||||
@@ -16,9 +13,12 @@ func get_mutation_name() -> String:
|
||||
func get_mutation_description() -> String:
|
||||
return tr("PURIFICATION_EFFECT_TEXT_LEVEL_%d") % get_purification_radius()
|
||||
|
||||
func _start_maturation_effect(_plant : Plant):
|
||||
print("Implement purification maturation effect")
|
||||
pass
|
||||
func _start_maturation_effect(plant : Plant):
|
||||
plant.region.decontaminate(Math.get_tiles_in_circle(
|
||||
plant.global_position,
|
||||
get_purification_radius() * (Region.TILE_SIZE + Region.TILE_SIZE/2.)
|
||||
))
|
||||
|
||||
|
||||
func get_purification_radius() -> int:
|
||||
return level
|
||||
|
||||
@@ -2,10 +2,7 @@ extends PlantMutation
|
||||
class_name QuickMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/chevrons-up.svg")
|
||||
|
||||
func get_base_rarity() -> int:
|
||||
return 0
|
||||
return preload("res://common/icons/hourglass-empty.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "QUICK"
|
||||
@@ -16,14 +13,17 @@ func get_mutation_name() -> String:
|
||||
func get_mutation_description() -> String:
|
||||
return tr("QUICK_EFFECT_TEXT_LEVEL").format({"score_increase": get_score_increase(), "lifetime_decrease": get_lifetime_decrease()})
|
||||
|
||||
func mutate_score(_plant_data: PlantData, score: int) -> int:
|
||||
func mutate_score(plant_data: PlantData, score: int) -> int:
|
||||
if not plant_data.is_mature():
|
||||
return score
|
||||
|
||||
return score + level
|
||||
|
||||
func mutate_lifetime(_plant_data: PlantData, lifetime: int) -> int:
|
||||
return max(lifetime - level, 1)
|
||||
return max(1, lifetime-get_lifetime_decrease())
|
||||
|
||||
func get_score_increase() -> int:
|
||||
return floori((level + 1.0) / 2)
|
||||
return level * 2
|
||||
|
||||
func get_lifetime_decrease() -> int:
|
||||
return maxi(0, 6 - get_score_increase())
|
||||
return 3
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
extends PlantMutation
|
||||
class_name SocialMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/chevrons-up.svg")
|
||||
const DEFAULT_PLANT_BY_POINT = 4
|
||||
|
||||
func get_base_rarity() -> int:
|
||||
return 0
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/users-group.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "SOCIABLE"
|
||||
@@ -14,11 +13,21 @@ func get_mutation_name() -> String:
|
||||
return tr("SOCIABLE")
|
||||
|
||||
func get_mutation_description() -> String:
|
||||
return tr("SOCIABLE_EFFECT_TEXT_LEVEL").format({"near_amount": get_near_plants_around()})
|
||||
return tr("SOCIABLE_EFFECT_TEXT_LEVEL").format(
|
||||
{
|
||||
"near_amount": get_near_plants_around(),
|
||||
"score_increase": get_score_increase()
|
||||
}
|
||||
)
|
||||
|
||||
func mutate_score(_plant_data: PlantData, score: int) -> int:
|
||||
printerr("TODO:: implement SOCIABLE score based on plants around")
|
||||
return score + level
|
||||
func mutate_score(plant_data: PlantData, score: int) -> int:
|
||||
if plant_data.get_state() != PlantData.State.MATURE:
|
||||
return score
|
||||
|
||||
return score + get_score_increase() * floori(len(plant_data.nearby_plants)/get_near_plants_around())
|
||||
|
||||
func get_near_plants_around():
|
||||
return 5 - level
|
||||
return max(DEFAULT_PLANT_BY_POINT - level,1)
|
||||
|
||||
func get_score_increase():
|
||||
return max(level - DEFAULT_PLANT_BY_POINT,1)
|
||||
|
||||
@@ -2,10 +2,7 @@ extends PlantMutation
|
||||
class_name ToughMutation
|
||||
|
||||
func get_icon() -> Texture:
|
||||
return preload("res://common/icons/chevrons-up.svg")
|
||||
|
||||
func get_base_rarity() -> int:
|
||||
return 0
|
||||
return preload("res://common/icons/shield.svg")
|
||||
|
||||
func get_mutation_id() -> String:
|
||||
return "TOUGH"
|
||||
@@ -20,7 +17,7 @@ func mutate_score_multiplier(_plant_data: PlantData, multiplier: int) -> int:
|
||||
return multiplier * 2
|
||||
|
||||
func mutate_growing_time(_plant_data: PlantData, growing_time: int) -> int:
|
||||
return growing_time + get_growing_time_increase()
|
||||
return maxi(0, growing_time + get_growing_time_increase())
|
||||
|
||||
func get_growing_time_increase()->int:
|
||||
return maxi(0, 3 - level)
|
||||
return 4 - level
|
||||
|
||||
Reference in New Issue
Block a user