From 09e1f1f72e8231f313675eeb1546088f57a2312b Mon Sep 17 00:00:00 2001 From: onpon4 Date: Fri, 6 Mar 2015 16:25:12 -0500 Subject: [PATCH] Some adjustments to weapons. * Modified the upgrade limits, to both be uniform and allow upgrades for every factor. (In fact, each one can be upgraded exactly once now.) * Gave triple-spread weapon double damage. * Micro rocket damage down from 7 to 6. Total damage is now equal to double rockets. --- src/defs.h | 4 +-- src/game.cpp | 15 +++-------- src/shop.cpp | 69 +++++++++++++++++++++++++++++++++---------------- src/weapons.cpp | 6 ++--- 4 files changed, 56 insertions(+), 38 deletions(-) diff --git a/src/defs.h b/src/defs.h index 7fc5cae..79d4c00 100644 --- a/src/defs.h +++ b/src/defs.h @@ -293,11 +293,11 @@ enum { SHOP_PLASMA_MAX_OUTPUT, SHOP_PLASMA_MAX_DAMAGE, SHOP_PLASMA_MAX_RATE, - SHOP_PLASMA_AMMO, - SHOP_ROCKET_AMMO, SHOP_PLASMA_MIN_OUTPUT, SHOP_PLASMA_MIN_DAMAGE, SHOP_PLASMA_MIN_RATE, + SHOP_PLASMA_AMMO, + SHOP_ROCKET_AMMO, SHOP_PLASMA_MAX_AMMO, SHOP_ROCKET_MAX_AMMO, SHOP_DOUBLE_ROCKETS, diff --git a/src/game.cpp b/src/game.cpp index afd2b9c..a0f6efc 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -68,10 +68,10 @@ void newGame() currentGame.maxRocketAmmo = 10; currentGame.minPlasmaRateLimit = 2; - currentGame.minPlasmaDamageLimit = 1; - currentGame.minPlasmaOutputLimit = 3; - currentGame.maxPlasmaRateLimit = 4; - currentGame.maxPlasmaDamageLimit = 2; + currentGame.minPlasmaDamageLimit = 2; + currentGame.minPlasmaOutputLimit = 2; + currentGame.maxPlasmaRateLimit = 3; + currentGame.maxPlasmaDamageLimit = 3; currentGame.maxPlasmaOutputLimit = 3; currentGame.maxPlasmaAmmoLimit = 250; currentGame.maxRocketAmmoLimit = 50; @@ -104,13 +104,6 @@ void newGame() currentGame.maxPlasmaOutput = 1; currentGame.maxPlasmaDamage = 1; currentGame.maxRocketAmmo = 5; - - currentGame.minPlasmaRateLimit = 2; - currentGame.minPlasmaDamageLimit = 1; - currentGame.minPlasmaOutputLimit = 2; - currentGame.maxPlasmaRateLimit = 3; - currentGame.maxPlasmaDamageLimit = 1; - currentGame.maxPlasmaOutputLimit = 3; break; default: player.maxShield = 50; diff --git a/src/shop.cpp b/src/shop.cpp index a90a395..659c715 100644 --- a/src/shop.cpp +++ b/src/shop.cpp @@ -206,7 +206,10 @@ static void drawShop() icons = SHOP_CHARGER + 1; for (int i = 0 ; i < icons ; i++) - blit(shape[shopItems[i].image], shopItems[i].x - 90, shopItems[i].y - 178, shopSurface[3]); + { + blit(shape[shopItems[i].image], shopItems[i].x - 90, + shopItems[i].y - 178, shopSurface[3]); + } sprintf(description, "Shield Units : %d", player.maxShield); drawString(description, 10, 4, FONT_WHITE, shopSurface[4]); @@ -364,11 +367,23 @@ void initShop() "Fires several small homing missiles (max %i missiles)", maxMicroHoming); shopItems[SHOP_MICRO_HOMING_MISSILES].image = 25; - for (int i = 0 ; i < 3 ; i++) - { - shopItems[i].x = 100 + (i * 50); - shopItems[i].y = 200; - } + shopItems[SHOP_PLASMA_MAX_OUTPUT].x = 100; + shopItems[SHOP_PLASMA_MAX_OUTPUT].y = 200; + + shopItems[SHOP_PLASMA_MAX_DAMAGE].x = 150; + shopItems[SHOP_PLASMA_MAX_DAMAGE].y = 200; + + shopItems[SHOP_PLASMA_MAX_RATE].x = 200; + shopItems[SHOP_PLASMA_MAX_RATE].y = 200; + + shopItems[SHOP_PLASMA_MIN_OUTPUT].x = 100; + shopItems[SHOP_PLASMA_MIN_OUTPUT].y = 260; + + shopItems[SHOP_PLASMA_MIN_DAMAGE].x = 150; + shopItems[SHOP_PLASMA_MIN_DAMAGE].y = 260; + + shopItems[SHOP_PLASMA_MIN_RATE].x = 200; + shopItems[SHOP_PLASMA_MIN_RATE].y = 260; shopItems[SHOP_PLASMA_AMMO].x = 350; shopItems[SHOP_PLASMA_AMMO].y = 200; @@ -376,23 +391,32 @@ void initShop() shopItems[SHOP_ROCKET_AMMO].x = 400; shopItems[SHOP_ROCKET_AMMO].y = 200; - for (int i = 0 ; i < 3 ; i++) - { - shopItems[i + 5].x = 100 + (i * 50); - shopItems[i + 5].y = 260; - } + shopItems[SHOP_PLASMA_MAX_AMMO].x = 450; + shopItems[SHOP_PLASMA_MAX_AMMO].y = 200; - for (int i = 0 ; i < 2 ; i++) - { - shopItems[i + 8].x = 450 + (i * 50); - shopItems[i + 8].y = 200; - } + shopItems[SHOP_ROCKET_MAX_AMMO].x = 500; + shopItems[SHOP_ROCKET_MAX_AMMO].y = 200; - for (int i = 0 ; i < 7 ; i++) - { - shopItems[i + 10].x = 350 + (i * 50); - shopItems[i + 10].y = 260; - } + shopItems[SHOP_DOUBLE_ROCKETS].x = 350; + shopItems[SHOP_DOUBLE_ROCKETS].y = 260; + + shopItems[SHOP_MICRO_ROCKETS].x = 400; + shopItems[SHOP_MICRO_ROCKETS].y = 260; + + shopItems[SHOP_LASER].x = 450; + shopItems[SHOP_LASER].y = 260; + + shopItems[SHOP_HOMING_MISSILE].x = 500; + shopItems[SHOP_HOMING_MISSILE].y = 260; + + shopItems[SHOP_CHARGER].x = 550; + shopItems[SHOP_CHARGER].y = 260; + + shopItems[SHOP_DOUBLE_HOMING_MISSILES].x = 600; + shopItems[SHOP_DOUBLE_HOMING_MISSILES].y = 260; + + shopItems[SHOP_MICRO_HOMING_MISSILES].x = 650; + shopItems[SHOP_MICRO_HOMING_MISSILES].y = 260; shopSelectedItem = -1; @@ -821,7 +845,8 @@ void showShop() { for (int i = 0 ; i < icons ; i++) { - if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, shopItems[i].x, shopItems[i].y, 32, 25)) + if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, + shopItems[i].x, shopItems[i].y, 32, 25)) { shopSelectedItem = i; engine.keyState[KEY_FIRE] = 0; diff --git a/src/weapons.cpp b/src/weapons.cpp index 223ba6b..8b6cc4d 100644 --- a/src/weapons.cpp +++ b/src/weapons.cpp @@ -80,7 +80,7 @@ void initWeapons() // Micro Rockets weapon[W_MICRO_ROCKETS].id = WT_ROCKET; weapon[W_MICRO_ROCKETS].ammo[0] = 5; - weapon[W_MICRO_ROCKETS].damage = 7; + weapon[W_MICRO_ROCKETS].damage = 6; weapon[W_MICRO_ROCKETS].reload[0] = 30; weapon[W_MICRO_ROCKETS].speed = 15; weapon[W_MICRO_ROCKETS].flags = WF_VARIABLE_SPEED; @@ -142,7 +142,7 @@ void initWeapons() weapon[W_MICRO_HOMING_MISSILES].imageIndex[0] = 4; weapon[W_MICRO_HOMING_MISSILES].imageIndex[1] = 4; - // Aimed plasma bolt (2x damage) + // Aimed plasma bolt weapon[W_AIMED_SHOT].id = WT_DIRECTIONAL; weapon[W_AIMED_SHOT].ammo[0] = 1; weapon[W_AIMED_SHOT].damage = 2; @@ -155,7 +155,7 @@ void initWeapons() // 3 way spread weapon weapon[W_SPREADSHOT].id = WT_SPREAD; weapon[W_SPREADSHOT].ammo[0] = 3; - weapon[W_SPREADSHOT].damage = 1; + weapon[W_SPREADSHOT].damage = 2; weapon[W_SPREADSHOT].reload[0] = 10; weapon[W_SPREADSHOT].speed = 10; weapon[W_SPREADSHOT].flags = WF_SPREAD;