Example #1
0
 public TournamentAdminInfo ToTournamentAdminInfo(SanityHtmlBuilder htmlBuilder)
 {
     return(new TournamentAdminInfo {
         Slug = Slug?.Current,
         MainImage = MainImage?.Asset?.Value?.Url,
         Logo = Logo?.Asset?.Value?.Url,
         Title = Title?.GetForCurrentCulture(),
         Body = Body?.GetForCurrentCulture(htmlBuilder),
         ToornamentId = ToornamentId,
         RegistrationForm = RegistrationForm?.GetForCurrentCulture(),
         RegistrationOpen = RegistrationOpen,
         TelegramLink = TelegramLink,
         LiveStream = LiveStream,
         LiveChat = LiveChat,
         Game = Game?.Value?.ToGame(),
         Id = Id,
         SignupType = SignupType,
         RequiredInformation = RequiredInfo?.Select(s => s.GetForCurrentCulture()).ToList(),
         TeamSize = TeamSize,
         SoloPlayers = SoloPlayers?.Select(p => p.ToParticipant()).ToList(),
         CategoryIds = Categories?.Select(c => c.Ref).ToList(),
         Winner = Winner?.Value?.Name,
         Contacts = Contacts,
         Responsible = Responsible?.Value,
         ResponsibleId = Responsible?.Ref,
         ParticipantTeams = Teams?.Select(t => t.ToParticipant()).ToList(),
     });
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     p1SP             = player1.GetComponent <SoloPlayers> ();
     p2SP             = player2.GetComponent <SoloPlayers> ();
     player1Transform = player1.transform.localPosition;
     player2Transform = player2.transform.localPosition;
 }
Example #3
0
    public virtual void OnCollisionEnter2D(Collision2D coll)
    {
        //Handles collisions with players.
        if (coll.gameObject.tag == "Player")
        {
            SoloPlayers p = coll.gameObject.GetComponent <SoloPlayers> ();
            if (p.playerNum != owner)
            {
                hitPlayer(p);
            }
            //Ignores collision if colliding with player who performed that attack (so you can't hit yourself).
            if (p.playerNum == owner)
            {
                Physics2D.IgnoreCollision(coll.gameObject.GetComponent <Collider2D> (), GetComponent <Collider2D> ());
            }
        }

        if (coll.gameObject.tag == "Fusion")
        {
            Physics2D.IgnoreCollision(coll.gameObject.GetComponent <Collider2D> (), GetComponent <Collider2D> ());
        }

        if (coll.gameObject.tag == "Wall")
        {
            Doors d = coll.gameObject.GetComponent <Doors> ();
            if (d != null)
            {
                if (owner == d.playerNum)
                {
                    Destroy(coll.gameObject);
                    killProjectile();
                }
            }
        }
    }
Example #4
0
    public void defuse(Vector3 p1Pos, Vector3 p2Pos)
    {
        fusion.GetComponent <IYHFusionPlayer> ().separationCountDown = fusion.GetComponent <IYHFusionPlayer> ().maxSeparationCountDown;
        fusion.SetActive(false);
//		Camera.main.GetComponent<DynamicCamera> ().fused = false;
        p1.SetActive(true);
        p1.transform.position = p1Pos;
        p2.SetActive(true);
        p2.transform.position = p2Pos;
        SoloPlayers p1SP = p1.GetComponent <SoloPlayers> ();
        SoloPlayers p2SP = p2.GetComponent <SoloPlayers> ();

        p1SP.actionable    = true;
        p1SP.incapacitated = false;
        p1SP.HP            = p1SP.maxHP;
        p2SP.actionable    = true;
        p2SP.incapacitated = false;
        p2SP.HP            = p1SP.maxHP;
    }
Example #5
0
    void OnCollisionEnter2D(Collision2D coll)
    {
        //Reset Jumps upon touching ground
        if (coll.gameObject.tag == "Floor")
        {
            touchingGround = true;
        }

        if (coll.gameObject.tag == "Wall")
        {
            touchingWall = true;
        }

        if (coll.gameObject.tag == "Player")
        {
            SoloPlayers other = coll.gameObject.GetComponent <SoloPlayers> ();
            if (readyToFuse == true && other.readyToFuse == true)
            {
                if (incapacitated == false)
                {
                    if (other.incapacitated == false)
                    {
                        this.gameObject.SetActive(false);
                        coll.gameObject.SetActive(false);
                        GameManager gm = GameObject.Find("GameManager").GetComponent <GameManager> ();
                        gm.IYHcreateFusion(transform.position, "Both");
                    }
                    else
                    {
                        this.gameObject.SetActive(false);
                        coll.gameObject.SetActive(false);
                        GameManager gm = GameObject.Find("GameManager").GetComponent <GameManager> ();
                        gm.IYHcreateFusion(transform.position, this.gameObject.name);
                    }
                }
            }
        }
    }
Example #6
0
    // Update is called once per frame
    void Update()
    {
        altControl();

        //detect whether input sth
        if (Input.GetAxis("LeftStickX_P" + owner) == 0 && Input.GetAxis("LeftStickY_P" + owner) == 0)
        {
            noInput = true;
        }
        else
        {
            noInput = false;
        }

        sp = GetComponentInParent <SoloPlayers> ();         //two smaller ones
        fp = GetComponentInParent <IYHFusionPlayer> ();     //two player together
        sr = GetComponent <SpriteRenderer> ();

//		Debug.Log(initPos);
        transform.localPosition = new Vector3(placement.x, placement.y, 0);

        //if it is fusionIndicator, it shows the in-between arrow of both arrows
        if (fusionIndicator == false)
        {
            //Debug.Log(movementX);
            //direction pointing at
            pointDirection = new Vector3((Input.GetAxis(movementX)), (Input.GetAxis(movementY)) * -1, 0);
            //Debug.Log(pointDirection);
            if (pointDirection != Vector3.zero)
            {
                //calc the angle it points at
                float angle = Mathf.Atan2(pointDirection.y, pointDirection.x) * Mathf.Rad2Deg;
                transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);
            }
            placement = new Vector2(Input.GetAxis(movementX), (Input.GetAxis(movementY) * -1)).normalized;

            //solo player is not null
//			if (sp != null) {
//				if (sp.touchingGround == true)
//				{
////					if (placement.y <= 0) {
////						transform.localPosition = new Vector2 (placement.x, 0);
////					}
//					if (placement.x == 0)
//					{
//						placement.x = sp.directionModifier;
//						placement.y = 0;
//					}
//				}
//			}

            //fusion player is not null
            if (fp != null)
            {
                if (fp.touchingGround == true)
                {
                    if (placement.y <= 0)
                    {
                        transform.localPosition = new Vector2(placement.x, 0);
                    }
                }
            }
        }
        else
        {
            placement      = new Vector2(fp.stickPosX, fp.stickPosY * -1);
            pointDirection = new Vector3(fp.stickPosX, fp.stickPosY * -1, 0);

            if (pointDirection != Vector3.zero)
            {
                //Debug.Log("in");
                float angle = Mathf.Atan2(pointDirection.y, pointDirection.x) * Mathf.Rad2Deg;
                //transform.LookAt(transform.position+pointDirection);
                transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);
            }
        }

        //Debug.Log(transform.localRotation.eulerAngles.z);
        //try to flip it but not working now
//		if (transform.localRotation.eulerAngles.z <= 180 && transform.localRotation.eulerAngles.z > 90) {
//			Debug.Log("flip");
//			Debug.Log(transform.localRotation.eulerAngles.z);
//			GetComponent<SpriteRenderer> ().flipY = true;
//		} else if(transform.localRotation.eulerAngles.z >= 0 && transform.localRotation.eulerAngles.z <= 90) {
//			Debug.Log("unflip");
//			GetComponent<SpriteRenderer> ().flipY = false;
//		}

        if (pointDirection == Vector3.zero)
        {
            sr.color = alphadOut;
        }
        else
        {
            if (overlapping)
            {
                sr.color = fusionColor;
            }
            else
            {
                if (owner == 1)
                {
                    sr.color = p1Color;
                }
                if (owner == 2)
                {
                    sr.color = p2Color;
                }
                if (fusionIndicator)
                {
                    sr.color = fusionColor;
                }
            }
        }
    }
Example #7
0
 //Hanldes the colliions interaction between players and projectiles (same as in Attack Script).
 public virtual void hitPlayer(SoloPlayers p)
 {
     killProjectile();
     p.takeDamage(damage);
 }