示例#1
0
 void FFF(Fix64Vector2 direction)
 {
     direction = direction.CCWTurn(-Fix64.Pi / (Fix64)6);
     for (int bnum = 0; bnum < bulletamount; bnum++)
     {
         DoFire((spf + (direction * (Fix64)0.6)).ToV2(), (direction * (Fix64)bulletspeed).ToV2());
         direction = direction.CCWTurn(Fix64.Pi / (Fix64)8);
     }
 }
示例#2
0
    void FFF(Fix64Vector2 direction)
    {
        direction = direction.CCWTurn(-Fix64.Pi / (Fix64)10);
        fireball.GetComponent <SABulletScript>().sender = null;
        Fix64Vector2 spv2 = (Fix64Vector2)GetComponent <Rigidbody2D>().position;

        for (int bnum = 0; bnum < 8; bnum++)
        {
            DoFire((spv2 + direction).ToV2(), (direction.normalized() * (Fix64)BulletSpeed).ToV2());
            direction = direction.CCWTurn(Fix64.Pi / (Fix64)40);
        }
    }
示例#3
0
    public void work(Fix64Vector2 workdir)
    {
        Fix64Vector2 s  = workdir.normalized() * (Fix64)speed;
        Fix64Vector2 sA = s.CCWTurn(turnangle);
        Fix64Vector2 sB = s.CCWTurn(-turnangle);

        maxtime = (float)(workdir.Length() * (Fix64)2 / (sA + sB).Length());
        cA      = Instantiate(SC, transform.position, Quaternion.identity);
        cB      = Instantiate(SC, transform.position, Quaternion.identity);
        cA.GetComponent <Rigidbody2D>().velocity = sA.ToV2();
        cB.GetComponent <Rigidbody2D>().velocity = sB.ToV2();
        //enabled = true;
    }
示例#4
0
    public void DoFake(Vector2 Worldv2)
    {
        if (!faking)
        {
            return;
        }
        faking = false;
        Fix64Vector2 center = (Fix64Vector2)selfRB.position;
        Fix64Vector2 Realv2 = ((Fix64Vector2)Worldv2 - center).normalized() * (Fix64)2;

        gameObject.GetComponent <DoSkill>().DoClearJob();
        selfRB.position += Realv2.ToV2();
        for (int i = 0; i < 2; i++)
        {
            Realv2 = Realv2.CCWTurn((Fix64)2 * Fix64.Pi / (Fix64)3);
            GameObject nm = Instantiate(Faker, (center + Realv2).ToV2(), Quaternion.identity);
            nm.name = gameObject.name + "f" + i;
            if (GetComponent <MoveScript>().isme)
            {
                nm.GetComponent <SpriteRenderer>().color = Color.yellow;
            }
            nm.GetComponent <FakeCircleScript>().Beauty  = selfRB;
            nm.GetComponent <FakeCircleScript>().maxtime = maxfaketime - currentfaketime;
        }
        GetComponent <MoveScript>().stopwalking();
    }
示例#5
0
 public void FFF()
 {
     DoFire(((Fix64Vector2)GetComponent <Rigidbody2D>().position + (Fix64)0.6 * drt).ToV2(), (drt * (Fix64)bulletspeed).ToV2());
     firetime -= 0.1f;
     if (firetimes > maxfiretime)
     {
         firestart = false;
         return;
     }
     firetimes++;
     drt = drt.CCWTurn(-Fix64.Pi / (Fix64)90);
 }
示例#6
0
 void FixedUpdate()
 {
     pasttime += Time.fixedDeltaTime;
     if (pasttime >= maxtime)
     {
         gameObject.GetComponent <DestroyScript>().Destroyself();
         return;
     }
     nextv = (Fix64Vector2)selfRB.velocity;
     Debug.Log("m" + (float)magicn);
     selfRB.velocity = nextv.CCWTurn(magicn).ToV2();
 }
示例#7
0
    public void Skill(Fix64Vector2 actionplace)
    {
        Fix64Vector2 singplace      = (Fix64Vector2)(Vector2)transform.position;
        Fix64Vector2 skilldirection = actionplace - singplace;
        float        realdistance   = Mathf.Min((float)skilldirection.Length(), maxdistance);

        if (realdistance <= 0.51)
        {
            return;
        }   //半径小于自身半径时不施法
        GetComponent <DoSkill>().BeforeSkill();
        currentcooldown = 0;
        skillavaliable  = false;
        bulletspeed     = realdistance * 1.13f / (maxtime - 0.5f);
        Fix64Vector2 fp1 = skilldirection.normalized().CCWTurn(Fix64.Pi / (Fix64)4);

        DoFire(singplace, fp1 * (Fix64)bulletspeed, false);
        fp1 = fp1.CCWTurn(-Fix64.Pi / (Fix64)2);
        DoFire(singplace, fp1 * (Fix64)bulletspeed, true);
    }
示例#8
0
    void PCBorn(int MNum)
    {
        CreateGround();
        Fix64Vector2 fix64Vector2 = new Fix64Vector2((Fix64)0, (Fix64)3);

        for (int i = MNum - 1; i >= 0; i--)
        {
            fix64Vector2  = fix64Vector2.CCWTurn(Fix64.PiTimes2 / (Fix64)MNum);
            thePC[i]      = Instantiate(PlayerCircle, fix64Vector2.ToV2(), Quaternion.identity);
            thePC[i].name = i.ToString();
            theMS[i]      = thePC[i].GetComponent <MoveScript>();
            theDS[i]      = thePC[i].GetComponent <DoSkill>();
            thePC[i].GetComponent <HPScript>().ser = GetComponent <Sender>();
            thePC[i].GetComponent <CircleSkillMem>().SetCircleSL(Sender.theSLtemp[i]);
            if (i == Sender.clientNum)
            {
                theMS[i].itsme();
            }
        }
    }
示例#9
0
 public void FFF()
 {
     DoFire((drt * (Fix64)BulletSpeed).ToV2());
     drt       = drt.CCWTurn((Fix64)1);
     firetime -= 0.2f;
 }