Skip to content
This repository has been archived by the owner on Jun 3, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/1.1_d'
Browse files Browse the repository at this point in the history
  • Loading branch information
su8ru committed Jun 14, 2019
2 parents d92a126 + 28b2adc commit df7e954
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 29 deletions.
4 changes: 2 additions & 2 deletions SpaceWars2/Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Config {
// version
const String VERSION = L"1.0_d";
const int VER_NUM = 19061403;
const String VERSION = L"1.1_d";
const int VER_NUM = 19061423;

// タイトル
const String TITLE = L"SpaceWars 2";
Expand Down
10 changes: 8 additions & 2 deletions SpaceWars2/functions/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,19 @@ bool Player::skillSelect() {
bool returnFlag = false;

if (selectedType != 2) {
if (KeyRight.repeat(20, true)) {
if (
KeyRight.repeat(20, true) ||
(isLeft ? Data::LKeySelect.repeat(20, true) : Data::RKeySelect.repeat(20, true))
) {
++selectedType;
returnFlag = true;
}
}
if (selectedType != 0) {
if (KeyLeft.repeat(20, true)) {
if (
KeyLeft.repeat(20, true) ||
(isLeft ? Data::LKeyBack.repeat(20, true) : Data::RKeyBack.repeat(20, true))
) {
--selectedType;
returnFlag = true;
}
Expand Down
2 changes: 1 addition & 1 deletion SpaceWars2/functions/Player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Player {

bool inAbsorption;

const int requireCharge[4] = { 400, 250, 400, 200 };
const int requireCharge[4] = { 400, 250, 400, 500 };

bool inRecovery;
static bool inJudgmentTime;
Expand Down
8 changes: 4 additions & 4 deletions SpaceWars2/functions/XInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ void GamePad::SetButton() {

// 操作
input.addButton(L"KeyEnter", s3d::Input::KeyEnter | XInput(0).buttonA | XInput(1).buttonA);
input.addButton(L"L_KeyBack", s3d::Input::KeyLControl | s3d::Input::KeyBackspace | s3d::Input::KeyEnd);
input.addButton(L"R_KeyBack", s3d::Input::KeyRControl | s3d::Input::KeyBackspace | s3d::Input::KeyEnd);
input.addButton(L"L_KeySelect", s3d::Input::KeyLShift | XInput(0).buttonA | XInput(0).buttonB);
input.addButton(L"R_KeySelect", s3d::Input::KeyRShift | XInput(1).buttonA | XInput(1).buttonB);
input.addButton(L"L_KeyBack", s3d::Input::KeyLControl | s3d::Input::KeyBackspace | s3d::Input::KeyEnd | XInput(0).buttonB);
input.addButton(L"R_KeyBack", s3d::Input::KeyRControl | s3d::Input::KeyBackspace | s3d::Input::KeyEnd | XInput(1).buttonB);
input.addButton(L"L_KeySelect", s3d::Input::KeyLShift | XInput(0).buttonA);
input.addButton(L"R_KeySelect", s3d::Input::KeyRShift | XInput(1).buttonA);
}


Expand Down
8 changes: 8 additions & 0 deletions SpaceWars2/scenes/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ void Game::update() {
++itr;
}
}
} else {
for (auto itr = bullets.begin(); itr != bullets.end();) {
if (!(**itr).isVisible()) {
delete* itr;
itr = bullets.erase(itr);
}
else { ++itr; }
}
}

if (Data::LPlayer.isHPRunOut() || Data::RPlayer.isHPRunOut())
Expand Down
28 changes: 14 additions & 14 deletions SpaceWars2/scenes/SkillSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ void SkillSelect::init() {
skillDescriptionManager.AddDescript(str);
}

Rect rect[4];
Image img[4];
String strings[4] = {L"ダメージ", L"発射間隔", L"使いやすさ", L"弾速"};
for (int i = 0; i < 4; i++) {
rect[i] = SmartUI::Get(S12).region(strings[i]);
img[i].resize(rect[i].size);
SmartUI::Get(S12).overwrite(img[i], strings[i], { 0, 0 }, Color(L"#fff"));
rotatedDescription[i] = Texture(img[i]);
}

for (auto i : step(5)) {
TextureAsset::Register(L"mainBullet" + Format(i), L"/810" + Format(i));
TextureAsset::Register(L"subBullet" + Format(i), L"/811" + Format(i));
Expand All @@ -89,6 +79,16 @@ void SkillSelect::init() {
TextureAsset::Register(L"specialTriangle", L"/7412");
isLoaded = true;
}

Rect rect[4];
Image img[4];
String strings[4] = { L"ダメージ", L"発射間隔", L"使いやすさ", L"弾速" };
for (int i = 0; i < 4; i++) {
rect[i] = SmartUI::Get(S12).region(strings[i]);
img[i].resize(rect[i].size);
SmartUI::Get(S12).overwrite(img[i], strings[i], { 0, 0 }, Color(L"#fff"));
rotatedDescription[i] = Texture(img[i]);
}
}

void SkillSelect::update() {
Expand All @@ -100,18 +100,18 @@ void SkillSelect::update() {
if (LReady && RReady) ++nextStageTime;
else nextStageTime = 0;

if (Data::LKeySelect.repeat(20, true) && !LReady) {
if (Data::LPlayer.selectedType == 2 && !LReady && Data::LKeySelect.repeat(20, true)) {
LReady = true;
SoundAsset(L"click1").setVolume(Config::MASTER_VOLUME * Config::CURSOR_VOLUME);
SoundAsset(L"click1").playMulti();
}
if (Data::RKeySelect.repeat(20, true) && !RReady) {
if (Data::RPlayer.selectedType == 2 && !RReady && Data::RKeySelect.repeat(20, true)) {
RReady = true;
SoundAsset(L"click1").setVolume(Config::MASTER_VOLUME * Config::CURSOR_VOLUME);
SoundAsset(L"click1").playMulti();
}
if (Data::LKeySelect.repeat(20, true)) LReady = true;
if (Data::RKeySelect.repeat(20, true)) RReady = true;
if (LReady && Data::LKeyBack.repeat(20, true)) LReady = false;
if (RReady && Data::RKeyBack.repeat(20, true)) RReady = false;

// 機体の処理
for (int isLeft = 0; isLeft < 2; isLeft++) {
Expand Down
2 changes: 1 addition & 1 deletion SpaceWars2/scenes/SkillSelect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SkillSelect final : public SceneManager<String, CommonData>::Scene {
int nextStageTime = 0;
bool LReady = false;
bool RReady = false;
Texture rotatedDescription[4] = {};
Texture rotatedDescription[4];
Vec2 playerPos[2][2] = {};
bool moveToUp[2][2] = {};
int skillsDisplayed[2][3] = {}; //[isLeft][skillType]
Expand Down
3 changes: 2 additions & 1 deletion SpaceWars2/skills/InversionRecovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
bool InversionRecovery::update(Vec2 _myPos, Vec2 _oppPos) {
if ((time > TRICKING_TIME) && !inRecovery){
inRecovery = true;
recoverAmount = (int)(PLAYER->recoveryDamage * 2.3);
recoverAmount = (int)(PLAYER->recoveryDamage * recoverEfficiency);
recoverAmount = Clamp(recoverAmount, 0, (int)(initHP * recoverEfficiency * (1.5)));
PLAYER->inAbsorption = false;
SoundAsset(L"IR").setVolume(Config::MASTER_VOLUME * Config::EFFECT_VOLUME);
SoundAsset(L"IR").playMulti();
Expand Down
5 changes: 3 additions & 2 deletions SpaceWars2/skills/InversionRecovery.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ class InversionRecovery : public Bullet {
private:
int initHP;
int time = 0;
int recoverAmount = 1;
int recoverAmount = 0; //回復量
int recoverEfficiency = 2; //回復量の受けたダメージに対する割合 実際に回復する量はこれから1を引いたものとなる
bool inRecovery;
Player* PLAYER;

const int TRICKING_TIME = 120;
const int TRICKING_TIME = 150;

public:
InversionRecovery(Vec2 _pos, bool _isLeft) : Bullet(_pos, _isLeft) {
Expand Down
2 changes: 1 addition & 1 deletion SpaceWars2/skills/Reflection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bool Reflection::update(Vec2 myPos, Vec2 oppPos) {
}

void Reflection::draw() {
getShape().draw(Color(isLeft ? L"#00ffff" : L"#0000ff"));
getShape().draw(Color(isLeft ? L"#00ffff" : L"#00ff00"));
}

bool Reflection::isVisible() {
Expand Down
2 changes: 1 addition & 1 deletion SpaceWars2/skills/SummonPartner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ bool SummonPartner::update(Vec2 myPos, Vec2 oppPos) {
LifeTime--;
if (!(LifeTime % 30)) {
Bullet* bul = new Grenade(shrinkVec2(pos, activeField, Rect(0, 0, Window::Width(), Window::Height())), isLeft);
bul->shrink(activeField);
if(shrinkRate!=1) bul->shrink(activeField);
bullets.push_back(bul);
}
for(auto itr = bullets.begin(); itr != bullets.end();){
Expand Down

0 comments on commit df7e954

Please sign in to comment.