Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
180
scripts/backround_scenes_scripts/Sarai.gd
Normal file
180
scripts/backround_scenes_scripts/Sarai.gd
Normal file
|
@ -0,0 +1,180 @@
|
|||
extends Node2D
|
||||
|
||||
const lightPower = 3.7
|
||||
const zoomTime = 3.5
|
||||
var cameraPosition
|
||||
|
||||
var thread;
|
||||
|
||||
func _ready():
|
||||
if not get_tree().root.has_node("Root"):
|
||||
return ;
|
||||
cameraPosition = Dialogic.get_variable("SaraiZoomed")
|
||||
var dialogicNode = get_parent().get_parent().get_node("Game").get_child(0).get_child(0)
|
||||
dialogicNode.connect("dialogic_signal", self, "_whospeaks_listener")
|
||||
|
||||
GallerySingleton.AddBackground("Sarai");
|
||||
|
||||
var isDay = true;
|
||||
if int(Dialogic.get_variable("SaraiFire")) == 1:
|
||||
if int(Dialogic.get_variable("SaraiZoomed")) == 1:
|
||||
self.scale = Vector2(1.5, 1.5)
|
||||
self.position = Vector2( - 960, - 540)
|
||||
ChangeParticleSize(0.9)
|
||||
$Background.visible = false;
|
||||
$Clouds.visible = false;
|
||||
$Day.visible = false
|
||||
$Night.visible = false
|
||||
$NightFire.visible = true
|
||||
$rain.visible = true;
|
||||
$Smoke.visible = true;
|
||||
if cameraPosition == "0":
|
||||
$NightFire / objects.visible = false
|
||||
else :
|
||||
$NightFire / objects.visible = true
|
||||
if int(Dialogic.get_variable("Is_Purple_Dead")) == 0:
|
||||
$NightFire / objects / Purple.visible = true
|
||||
if int(Dialogic.get_variable("Is_Red_Dead")) == 0:
|
||||
$NightFire / objects / Red.visible = true
|
||||
if int(Dialogic.get_variable("Is_Green_Dead")) == 0:
|
||||
$NightFire / objects / Green.visible = true
|
||||
if int(Dialogic.get_variable("Is_White_Dead")) == 0:
|
||||
$NightFire / objects / White.visible = true
|
||||
if int(Dialogic.get_variable("Is_Orange_Dead")) == 0:
|
||||
$NightFire / objects / Orange.visible = true
|
||||
|
||||
|
||||
|
||||
var sfxPath = "res://resources/audio/sfx/Sarai_fire.ogg"
|
||||
get_tree().root.get_node("Root").SetSFXforBGM(sfxPath)
|
||||
|
||||
var player = get_tree().root.get_node("/root/BgmScene/TweenBGMsfx/BGMStreamPlayer")
|
||||
$Lightning.Init(4, player);
|
||||
|
||||
GallerySingleton.AddBackground("Sarai_fire");
|
||||
|
||||
Dialogic.set_variable("Prichal", "1");
|
||||
else :
|
||||
if Dialogic.get_variable("ItIsDay") == "true":
|
||||
$Background.visible = true;
|
||||
$Day.visible = true
|
||||
$Clouds.visible = true;
|
||||
$Night.visible = false
|
||||
$NightFire.visible = false
|
||||
else :
|
||||
$Background.visible = false;
|
||||
$Clouds.visible = false;
|
||||
$Day.visible = false
|
||||
$Night.visible = true
|
||||
$NightFire.visible = false
|
||||
|
||||
$rain.visible = true;
|
||||
|
||||
var sfxPath = "res://resources/audio/sfx/Rain Loop.ogg"
|
||||
get_tree().root.get_node("Root").SetSFXforBGM(sfxPath)
|
||||
|
||||
var player = get_tree().root.get_node("/root/BgmScene/TweenBGMsfx/BGMStreamPlayer")
|
||||
$Lightning.Init(4, player);
|
||||
|
||||
GallerySingleton.AddBackground("Sarai_n");
|
||||
|
||||
func _whospeaks_listener(string):
|
||||
EndSpeech()
|
||||
match string:
|
||||
"Brown":
|
||||
$NightFire / objects / Brown / Brown_light.energy = lightPower
|
||||
"Purple":
|
||||
$NightFire / objects / Purple / Purple_light.energy = lightPower
|
||||
"Red":
|
||||
$NightFire / objects / Red / Red_light.energy = lightPower
|
||||
"Green":
|
||||
$NightFire / objects / Green / Green_light.energy = lightPower
|
||||
"White":
|
||||
$NightFire / objects / White / White_light.energy = lightPower
|
||||
"Orange":
|
||||
$NightFire / objects / Orange / Orange_light.energy = lightPower
|
||||
"zoom":
|
||||
ZoomIn()
|
||||
Dialogic.set_variable("SaraiZoomed", 1)
|
||||
"zoom_out":
|
||||
ZoomOut()
|
||||
Dialogic.set_variable("SaraiZoomed", 0)
|
||||
|
||||
|
||||
|
||||
func EndSpeech():
|
||||
$NightFire / objects / Brown / Brown_light.energy = 0
|
||||
$NightFire / objects / Green / Green_light.energy = 0
|
||||
$NightFire / objects / Orange / Orange_light.energy = 0
|
||||
$NightFire / objects / Purple / Purple_light.energy = 0
|
||||
$NightFire / objects / Red / Red_light.energy = 0
|
||||
$NightFire / objects / White / White_light.energy = 0
|
||||
|
||||
func ZoomIn():
|
||||
$Tween.interpolate_property(self, "scale", Vector2(1, 1), Vector2(1.5, 1.5), zoomTime, Tween.TRANS_LINEAR, 0)
|
||||
$Tween.interpolate_property(self, "position", Vector2(0, 0), Vector2( - 960, - 540), zoomTime, Tween.TRANS_LINEAR, 0)
|
||||
$Tween.interpolate_method(self, "ChangeParticleSize", 1.5, 0.9, zoomTime, Tween.TRANS_LINEAR, 0)
|
||||
$NightFire / objects.modulate.a = 0.0
|
||||
$NightFire / objects.visible = true
|
||||
$Tween.interpolate_property($NightFire / objects, "modulate", Color(1, 1, 1, 0), Color(1, 1, 1, 1), zoomTime, Tween.TRANS_LINEAR, 0)
|
||||
|
||||
$Tween.start()
|
||||
|
||||
func ZoomOut():
|
||||
$Tween.interpolate_property(self, "scale", self.scale, Vector2(1.5, 1.5), zoomTime, Tween.TRANS_LINEAR, 0)
|
||||
$Tween.interpolate_property(self, "position", self.position, Vector2( - 800, - 300), zoomTime, Tween.TRANS_LINEAR, 0)
|
||||
$Tween.interpolate_method(self, "ChangeParticleSize", 0.9, 1.5, zoomTime, Tween.TRANS_LINEAR, 0)
|
||||
$Tween.interpolate_property($NightFire / objects, "modulate", Color(1, 1, 1, 1), Color(1, 1, 1, 0), zoomTime, Tween.TRANS_LINEAR, 0)
|
||||
$Tween.start()
|
||||
|
||||
func ChangeParticleSize(size):
|
||||
$rain / Particles2D.process_material.scale = size
|
||||
|
||||
|
||||
func InitForGallery()->Array:
|
||||
scale = Vector2(0.5, 0.5)
|
||||
|
||||
var night = GallerySingleton.HaveBackground("Sarai_n");
|
||||
var fire = GallerySingleton.HaveBackground("Sarai_fire");
|
||||
|
||||
$Day.visible = true;
|
||||
$Clouds.visible = true;
|
||||
$Night.visible = false;
|
||||
$NightFire.visible = false;
|
||||
$Smoke.visible = false;
|
||||
$rain.visible = false;
|
||||
|
||||
if not night and not fire:
|
||||
return [];
|
||||
if night and not fire:
|
||||
return ["ui_day", "ui_night"]
|
||||
if not night and fire:
|
||||
return ["ui_day", "ui_gallery_fire"]
|
||||
return ["ui_day", "ui_night", "ui_gallery_fire"]
|
||||
|
||||
func SetSettings(setting):
|
||||
if setting == tr("ui_day"):
|
||||
$Background.visible = true;
|
||||
$Day.visible = true;
|
||||
$Clouds.visible = true;
|
||||
$Night.visible = false;
|
||||
$NightFire.visible = false;
|
||||
$Smoke.visible = false;
|
||||
$rain.visible = false;
|
||||
elif setting == tr("ui_night"):
|
||||
$Background.visible = false;
|
||||
$Clouds.visible = false;
|
||||
$Day.visible = false;
|
||||
$Night.visible = true;
|
||||
$NightFire.visible = false;
|
||||
$Smoke.visible = false;
|
||||
$rain.visible = true;
|
||||
|
||||
else :
|
||||
$Background.visible = false;
|
||||
$Clouds.visible = false;
|
||||
$Day.visible = false;
|
||||
$Night.visible = false;
|
||||
$NightFire.visible = true;
|
||||
$Smoke.visible = true;
|
||||
$rain.visible = true;
|
Loading…
Add table
Add a link
Reference in a new issue