Script Do Simulador De Lavagem De Pressao Apr 2026
if is_overheated and current_temp <= 70.0: is_overheated = false ShowMessage("Machine cooled. Ready to spray.") function RefillResources(): // Called at refill stations fuel_level = 100.0 soap_level = 100.0 current_temp = 40.0 // Reset to warm but not hot PlaySound("refill_click") Each cleanable object (wall, floor, vehicle) follows this interface.
// 3. Apply cleaning to surface float dirt_removed = hit_surface.Clean(cleaning_power, hit_point, spray_angle)
// Overheat logic if current_temp >= 100.0: is_overheated = true ForceStopSpray() PlaySound("overheat_alarm") ShowMessage("Machine Overheated! Wait to cool down.")
// 2. Calculate cleaning power float cleaning_power = CalculateCleaningPower() Script do Simulador de Lavagem de Pressao
UpdateUI() // Refresh HUD PlaySound("pump_idle_loop") This is the main loop triggered every frame while the player holds the trigger.
float final_power = base * nozzle_mod * temp_mod
if IsSpraying(): current_temp += heat_generated else: current_temp -= cooling if is_overheated and current_temp <= 70
function InitializeSimulator(): current_psi = 300.0 // Start with medium pressure current_temp = 20.0 // Cold water active_nozzle = NozzleType.GREEN fuel_level = 100.0 soap_level = 100.0 is_overheated = false combo_timer = 0.0 // Reset all dirt decals on surfaces for each surface in scene_surfaces: surface.dirt_amount = GetInitialDirtByLevel(current_level)
float temp_mod = 1.0 if current_temp > 60.0: // Hot water bonus temp_mod = 1.0 + (current_temp - 60.0) / 100.0
if combo_counter >= 10: combo_multiplier = 1.5 if combo_counter >= 25: combo_multiplier = 2.0 if combo_counter >= 50: combo_multiplier = 3.0 else: // Called every frame: decrement timer combo_timer -= delta_time if combo_timer <= 0.0: combo_counter = 0 combo_multiplier = 1.0 function OnLevelComplete(): int bonus = player_score * (fuel_level / 100) // Fuel efficiency bonus int total = player_score + bonus UnlockNextLevel() ShowScoreScreen(total) class UpgradeManager: int coins = 0 // Upgrade paths float pressure_upgrade = 1.0 // Multiplier: 1.0, 1.2, 1.5, 2.0 float heat_upgrade = 1.0 // Max temp: 100, 120, 150°C float fuel_capacity = 1.0 // Multiplier Apply cleaning to surface float dirt_removed = hit_surface
class CleanableSurface: float dirt_map[1024][1024] // Virtual texture for dirt (0=clean, 1=mud) float base_resistance // 0.2 (dust) to 0.9 (caked mud) float stain_type // Enum: MUD, OIL, RUST, MOSS function Clean(power, hit_point, angle): // Convert world hit to UV coordinate Vector2 uv = WorldToUV(hit_point) float radius = CalculateSplashRadius(angle) // Inches float total_cleaned = 0.0 for x in -radius to +radius: for y in -radius to +radius: float current_dirt = dirt_map[uv.x + x][uv.y + y] if current_dirt > 0: // Effective cleaning per tick float cleaning_rate = power * delta_time * 0.01 if stain_type == OIL and current_temp > 70: cleaning_rate *= 2.0 // Hot water melts oil float removed = Min(current_dirt, cleaning_rate) dirt_map[uv.x + x][uv.y + y] -= removed total_cleaned += removed // Update visual mesh/material UpdateDecalTexture(dirt_map) return total_cleaned
// --- Cleaning System --- float dirt_resistance = 0.0 to 1.0 (0 = clean, 1 = muddy) float heat_effectiveness = 0.5 // Hotter water cleans grease faster
return final_power Prevents infinite spraying and simulates engine wear.