using UnityEngine; namespace Auralis { public static partial class WorldBuilder { static void BuildWindSchool(Transform root) { Structure("Übungsplatz · geschützte Jasminloggia","FestivalHall",new Vector2(-15,0),7.8f,-10,new Color(.88f,.94f,.88f,1),root); Structure("Übungsplatz · Drachenmacherhaus","KiteWorkshop",new Vector2(16,0),7.2f,-9,new Color(.88f,.94f,.88f,1),root); // The low beam is a real solid ceiling, independent from the cosmetic rear loggia. var roof=new GameObject("Niedriger Übungsbalken");roof.transform.SetParent(root);roof.transform.position=new Vector3(-10,1.55f);roof.layer=6; var box=roof.AddComponent();box.size=new Vector2(5,.45f); var beam=ArtLibrary.Sprite("Balken · Holz und Messing",ArtLibrary.Get("PracticeBeam"),new Vector3(-10,1.325f),8,roof.transform);ArtLibrary.Width(beam,5.05f); foreach(float x in new[]{-13.1f,-6.9f}) { var post=ArtLibrary.Sprite("Übungsrahmen · tragender Pfosten",ArtLibrary.Get("PracticeBeam"),Vector3.zero,7,root);ArtLibrary.Width(post,4.9f);post.transform.rotation=Quaternion.Euler(0,0,90); post.transform.position+=new Vector3(x,0,0)-new Vector3(post.bounds.center.x,post.bounds.min.y,0); } var lintel=ArtLibrary.Sprite("Übungsrahmen · oberer Querbalken",ArtLibrary.Get("PracticeBeam"),new Vector3(-10,4.55f),7,root);ArtLibrary.Width(lintel,6.65f); SuspendedProp.Attach(roof,new[]{new Vector2(-12.35f,4.7f),new Vector2(-7.65f,4.7f)},new[]{new Vector2(-2.35f,.2f),new Vector2(2.35f,.2f)}); var target=new GameObject("Übungsring · kurzer Bogen");target.transform.SetParent(root);target.transform.position=new Vector3(18,1.15f);target.AddComponent(); var band=ArtLibrary.Sprite("Dashband · Windseide",ArtLibrary.Get("FestivalProps",0),new Vector2(10,.1f),10,root);ArtLibrary.Height(band,1.9f);band.color=new Color(1,.85f,.5f,.85f);band.gameObject.AddComponent().angle=2; var quest=new GameObject("Level 0 · spielerischer Einstieg");quest.transform.SetParent(root);quest.AddComponent(); new GameObject("Windschule · Dorf in der Tiefe").AddComponent(); new GameObject("Windschule · Lichtbahnen").AddComponent(); } public static void AddLadder(Transform root,float x,float bottom,float top) {var go=new GameObject("Leiter "+x+" · "+bottom);go.transform.SetParent(root);go.AddComponent().Init(x,bottom,top);} } public sealed class PracticeTarget:MonoBehaviour,IArrowTarget { SpriteRenderer image;float flash; void Start(){gameObject.layer=7;var c=gameObject.AddComponent();c.isTrigger=true;c.radius=.65f;image=ArtLibrary.Sprite("Windring",ArtLibrary.Get("FestivalProps",0),transform.position+Vector3.down*.7f,12,transform);ArtLibrary.Height(image,1.5f);} public void Hit(){flash=.35f;AudioDirector.I.Play("chime1",transform.position,.22f);WorldEffects.I.Burst(transform.position,ArtLibrary.Teal,9,1.6f);if(TrainingQuest.I)TrainingQuest.I.Mark(4);} void Update(){if(!GameSession.I.Playing)return;flash=Mathf.Max(0,flash-Time.deltaTime);image.color=flash>0?ArtLibrary.Teal:Color.white;} } }