public override void activate(Navi navi) { if (navi.active_chip != null) // deactivate any other active chip before activating { navi.active_chip.deactivate(navi); } navi.active_chip = this; // If being activated by me if (navi.localOwner.Id == navi.owner.Id) { AC_dispObj = navi.AC_dispA; } // If being activated by enemy if (navi.localOwner.Id != navi.owner.Id) { AC_dispObj = navi.AC_dispB; } AC_dispObj.SetActive(true); AC_disp = AC_dispObj.GetComponent <ActiveChipDisplay>(); AC_disp.RecieveData(this); AC_disp.max_duration = power; AC_disp.duration = power; AC_disp.power_text.text = "" + Math.Ceiling(AC_disp.duration); AC_disp.duration_ring.fillAmount = AC_disp.duration / AC_disp.max_duration; // ***** Buster Charge Up ****** int i = 0; while (i < navi.charge_levels.Length) { navi.charge_levels[i] *= 0.75f; // reduce time for full charge by 25% i++; } }
public override void activate(Navi navi) { if (navi.active_chip != null) // deactivate any other active chip before activating { navi.active_chip.deactivate(navi); } navi.active_chip = this; // If being activated by me if (navi.localOwner.Id == navi.owner.Id) { AC_dispObj = navi.AC_dispA; // ***** Fast Custom ****** navi.cust_dispA.GetComponent <Cust>().cust_speed /= 2; // Increase Cust speed by 50% } // If being activated by enemy if (navi.localOwner.Id != navi.owner.Id) { AC_dispObj = navi.AC_dispB; // ***** Fast Custom ****** navi.cust_dispB.GetComponent <Cust>().cust_speed /= 2; // Increase Cust speed by 50% } AC_dispObj.SetActive(true); AC_disp = AC_dispObj.GetComponent <ActiveChipDisplay>(); AC_disp.RecieveData(this); AC_disp.max_duration = power; AC_disp.duration = power; AC_disp.power_text.text = "" + Math.Ceiling(AC_disp.duration); AC_disp.duration_ring.fillAmount = AC_disp.duration / AC_disp.max_duration; }
public override void activate(Navi navi) { if (navi.active_chip != null) // deactivate any other active chip before activating { navi.active_chip.deactivate(navi); } navi.active_chip = this; // If being activated by me if (navi.localOwner.Id == navi.owner.Id) { AC_dispObj = navi.AC_dispA; } // If being activated by enemy if (navi.localOwner.Id != navi.owner.Id) { AC_dispObj = navi.AC_dispB; } // Setup Active Chip display AC_dispObj.SetActive(true); AC_disp = AC_dispObj.GetComponent <ActiveChipDisplay>(); AC_disp.RecieveData(this); AC_disp.max_duration = power; AC_disp.duration = power; AC_disp.power_text.text = "" + Math.Ceiling(AC_disp.duration); AC_disp.duration_ring.fillAmount = AC_disp.duration / AC_disp.max_duration; //audio navi.GetComponent <AudioSource>().PlayOneShot(Resources.Load <AudioClip>("Audio/Barrier HQ")); // Setup sprite renderer for chip's sprite chip_renderObj = new GameObject(); chip_renderObj.transform.SetParent(navi.transform, false); chip_renderObj.transform.position += navi.body_offset; // offset sprite up to match navi chip_renderObj.AddComponent <SpriteRenderer>(); chip_anim_frame = 0; chip_renderObj.GetComponent <SpriteRenderer>().sprite = chip_sprite[chip_anim_frame]; chip_renderObj.GetComponent <SpriteRenderer>().sortingOrder = 5; // ensures sprite appear overtop chip_renderObj.GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 0.5f); frametimer = chipFR; OnSyncedUpdate(navi); }