More enemy balancing
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="io.anuke.mindustry"
|
package="io.anuke.mindustry"
|
||||||
android:versionCode="23"
|
android:versionCode="24"
|
||||||
android:versionName="3.07b" >
|
android:versionName="3.08b" >
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />
|
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />
|
||||||
|
<uses-permission android:name="com.android.vending.BILLING" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
@@ -21,6 +22,9 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
<activity android:name=".DonationsActivity" />
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -1,3 +1,17 @@
|
|||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
jcenter()
|
||||||
|
maven {
|
||||||
|
url "https://maven.google.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile 'com.android.support:support-v4:22.1.1'
|
||||||
|
compile 'org.sufficientlysecure:donations:2.5'
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
buildToolsVersion "25.0.0"
|
buildToolsVersion "25.0.0"
|
||||||
compileSdkVersion 25
|
compileSdkVersion 25
|
||||||
@@ -31,6 +45,12 @@ android {
|
|||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
productFlavors {
|
||||||
|
google {
|
||||||
|
buildConfigField "boolean", "DONATIONS_GOOGLE", "true"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// called every time gradle gets executed, takes the native dependencies of
|
// called every time gradle gets executed, takes the native dependencies of
|
||||||
// the natives configuration, and extracts them to the proper libs/ folders
|
// the natives configuration, and extracts them to the proper libs/ folders
|
||||||
@@ -131,7 +151,3 @@ idea {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
|
||||||
//compile files('lib/ucore.jar')
|
|
||||||
}
|
|
||||||
15
android/res/layout/donations_activity.xml
Normal file
15
android/res/layout/donations_activity.xml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/donations_activity_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -2,5 +2,13 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<string name="app_name">Mindustry</string>
|
<string name="app_name">Mindustry</string>
|
||||||
|
<string-array name="donation_google_catalog_values">
|
||||||
|
<item>1 Dollar</item>
|
||||||
|
<item>2 Dollars</item>
|
||||||
|
<item>3 Dollars</item>
|
||||||
|
<item>5 Dollars</item>
|
||||||
|
<item>10 Dollars</item>
|
||||||
|
<item>15 Dollars</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.badlogic.gdx.backends.android.AndroidApplication;
|
|||||||
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import io.anuke.mindustry.io.Formatter;
|
import io.anuke.mindustry.io.Formatter;
|
||||||
@@ -38,6 +39,8 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Mindustry.donationsCallable = this::showDonations;
|
||||||
|
|
||||||
if(doubleScaleTablets){
|
if(doubleScaleTablets){
|
||||||
DisplayMetrics metrics = new DisplayMetrics();
|
DisplayMetrics metrics = new DisplayMetrics();
|
||||||
getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||||
@@ -56,6 +59,13 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
|
|
||||||
//Mindustry.args.add("-debug");
|
//Mindustry.args.add("-debug");
|
||||||
|
|
||||||
|
config.hideStatusBar = true;
|
||||||
|
|
||||||
initialize(new Mindustry(), config);
|
initialize(new Mindustry(), config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void showDonations(){
|
||||||
|
Intent intent = new Intent(this, DonationsActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
62
android/src/io/anuke/mindustry/DonationsActivity.java
Normal file
62
android/src/io/anuke/mindustry/DonationsActivity.java
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
package io.anuke.mindustry;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
import android.support.v4.app.FragmentManager;
|
||||||
|
import android.support.v4.app.FragmentTransaction;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx;
|
||||||
|
import com.badlogic.gdx.backends.android.AndroidGraphics;
|
||||||
|
|
||||||
|
import org.sufficientlysecure.donations.DonationsFragment;
|
||||||
|
|
||||||
|
public class DonationsActivity extends FragmentActivity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Google
|
||||||
|
*/
|
||||||
|
private static final String GOOGLE_PUBKEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg8bTVFK5zIg4FGYkHKKQ/j/iGZQlXU0qkAv2BA6epOX1ihbMz78iD4SmViJlECHN8bKMHxouRNd9pkmQKxwEBHg5/xDC/PHmSCXFx/gcY/xa4etA1CSfXjcsS9i94n+j0gGYUg69rNkp+p/09nO9sgfRTAQppTxtgKaXwpfKe1A8oqmDUfOnPzsEAG6ogQL6Svo6ynYLVKIvRPPhXkq+fp6sJ5YVT5Hr356yCXlM++G56Pk8Z+tPzNjjvGSSs/MsYtgFaqhPCsnKhb55xHkc8GJ9haq8k3PSqwMSeJHnGiDq5lzdmsjdmGkWdQq2jIhKlhMZMm5VQWn0T59+xjjIIwIDAQAB";
|
||||||
|
private static final String[] GOOGLE_CATALOG = new String[]{"ntpsync.donation.1",
|
||||||
|
"ntpsync.donation.2", "ntpsync.donation.3", "ntpsync.donation.5", "ntpsync.donation.8",
|
||||||
|
"ntpsync.donation.13"};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the activity is first created.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
//TODO
|
||||||
|
setContentView(((AndroidGraphics)Gdx.graphics).getView());
|
||||||
|
|
||||||
|
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||||
|
DonationsFragment donationsFragment;
|
||||||
|
if (BuildConfig.DONATIONS_GOOGLE) {
|
||||||
|
donationsFragment = DonationsFragment.newInstance(BuildConfig.DEBUG, true, GOOGLE_PUBKEY, GOOGLE_CATALOG,
|
||||||
|
getResources().getStringArray(R.array.donation_google_catalog_values), false, null, null,
|
||||||
|
null, false, null, null, false, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
ft.replace(R.id.donations_activity_container, donationsFragment, "donationsFragment");
|
||||||
|
ft.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Needed for Google Play In-app Billing. It uses startIntentSenderForResult(). The result is not propagated to
|
||||||
|
* the Fragment like in startActivityForResult(). Thus we need to propagate manually to our Fragment.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
||||||
|
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||||
|
Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment");
|
||||||
|
if (fragment != null) {
|
||||||
|
fragment.onActivityResult(requestCode, resultCode, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -79,7 +79,7 @@ project(":core") {
|
|||||||
apply plugin: "java"
|
apply plugin: "java"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.github.Anuken:ucore:6238d06'
|
compile 'com.github.Anuken:ucore:a1ae9be'
|
||||||
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||||
compile "com.badlogicgames.gdx:gdx-ai:1.8.1"
|
compile "com.badlogicgames.gdx:gdx-ai:1.8.1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,23 +13,16 @@ import io.anuke.mindustry.world.World;
|
|||||||
import io.anuke.mindustry.world.blocks.*;
|
import io.anuke.mindustry.world.blocks.*;
|
||||||
import io.anuke.ucore.core.Inputs;
|
import io.anuke.ucore.core.Inputs;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
|
import io.anuke.ucore.function.Callable;
|
||||||
import io.anuke.ucore.modules.ModuleCore;
|
import io.anuke.ucore.modules.ModuleCore;
|
||||||
import io.anuke.ucore.util.Profiler;
|
import io.anuke.ucore.util.Profiler;
|
||||||
|
|
||||||
public class Mindustry extends ModuleCore {
|
public class Mindustry extends ModuleCore {
|
||||||
|
public static Callable donationsCallable;
|
||||||
public static Array<String> args = new Array<>();
|
public static Array<String> args = new Array<>();
|
||||||
public static Formatter formatter = new Formatter(){
|
public static Formatter formatter = new Formatter(){
|
||||||
|
@Override public String format(Date date){ return "invalid date"; }
|
||||||
@Override
|
@Override public String format(int number){ return number + ""; }
|
||||||
public String format(Date date){
|
|
||||||
return "invalid date";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String format(int number){
|
|
||||||
return number + "";
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//always initialize blocks in this order, otherwise there are ID errors
|
//always initialize blocks in this order, otherwise there are ID errors
|
||||||
|
|||||||
@@ -180,12 +180,13 @@ public class Renderer extends RendererModule{
|
|||||||
Graphics.shader();
|
Graphics.shader();
|
||||||
|
|
||||||
Entities.draw(Entities.defaultGroup());
|
Entities.draw(Entities.defaultGroup());
|
||||||
Entities.draw(control.bulletGroup);
|
|
||||||
|
|
||||||
Profiler.end("entityDraw");
|
Profiler.end("entityDraw");
|
||||||
|
|
||||||
if(!optimize) drawBlocks(true, false);
|
if(!optimize) drawBlocks(true, false);
|
||||||
|
|
||||||
|
Entities.draw(control.bulletGroup);
|
||||||
|
|
||||||
drawShield();
|
drawShield();
|
||||||
|
|
||||||
drawOverlay();
|
drawOverlay();
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emp = new BulletType(1.6f, 8){
|
emp = new BulletType(1.6f, 6){
|
||||||
{
|
{
|
||||||
lifetime = 50f;
|
lifetime = 50f;
|
||||||
hitsize = 6f;
|
hitsize = 6f;
|
||||||
|
|||||||
@@ -149,8 +149,8 @@ public class WaveCreator{
|
|||||||
}},
|
}},
|
||||||
new EnemySpawn(FortressEnemy.class){{
|
new EnemySpawn(FortressEnemy.class){{
|
||||||
after = 12;
|
after = 12;
|
||||||
spacing = 4;
|
spacing = 5;
|
||||||
scaling = 6;
|
scaling = 7;
|
||||||
}},
|
}},
|
||||||
new EnemySpawn(HealerEnemy.class){{
|
new EnemySpawn(HealerEnemy.class){{
|
||||||
scaling = 3;
|
scaling = 3;
|
||||||
@@ -163,8 +163,8 @@ public class WaveCreator{
|
|||||||
}},
|
}},
|
||||||
new EnemySpawn(FlamerEnemy.class){{
|
new EnemySpawn(FlamerEnemy.class){{
|
||||||
after = 14;
|
after = 14;
|
||||||
spacing = 5;
|
spacing = 6;
|
||||||
scaling = 2;
|
scaling = 3;
|
||||||
}},
|
}},
|
||||||
new EnemySpawn(BlastEnemy.class){{
|
new EnemySpawn(BlastEnemy.class){{
|
||||||
after = 12;
|
after = 12;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class EMP extends TimedEntity{
|
|||||||
if(tile != null && tile.block() instanceof PowerAcceptor){
|
if(tile != null && tile.block() instanceof PowerAcceptor){
|
||||||
PowerAcceptor p = (PowerAcceptor)tile.block();
|
PowerAcceptor p = (PowerAcceptor)tile.block();
|
||||||
p.setPower(tile, 0f);
|
p.setPower(tile, 0f);
|
||||||
tile.entity.damage((int)(damage*1.6f)); //extra damage
|
tile.entity.damage((int)(damage*1.5f)); //extra damage
|
||||||
}
|
}
|
||||||
|
|
||||||
//entity may be null here, after the block is dead!
|
//entity may be null here, after the block is dead!
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public class Enemy extends DestructibleEntity{
|
|||||||
public final static Color[] tierColors = { Color.valueOf("ffe451"), Color.valueOf("f48e20"), Color.valueOf("ff6757"), Color.valueOf("ff2d86") };
|
public final static Color[] tierColors = { Color.valueOf("ffe451"), Color.valueOf("f48e20"), Color.valueOf("ff6757"), Color.valueOf("ff2d86") };
|
||||||
public final static int maxtier = 4;
|
public final static int maxtier = 4;
|
||||||
public final static float maxIdle = 60*1.5f;
|
public final static float maxIdle = 60*1.5f;
|
||||||
|
public final static float maxIdleLife = 60f*15f; //15 seconds idle = death
|
||||||
|
|
||||||
protected int timeid;
|
protected int timeid;
|
||||||
protected Timer timer = new Timer(5);
|
protected Timer timer = new Timer(5);
|
||||||
@@ -64,6 +65,13 @@ public class Enemy extends DestructibleEntity{
|
|||||||
void move(){
|
void move(){
|
||||||
Tile core = Vars.control.getCore();
|
Tile core = Vars.control.getCore();
|
||||||
|
|
||||||
|
if(idletime > maxIdleLife){
|
||||||
|
Effects.effect(Fx.shellsmoke, this);
|
||||||
|
Effects.effect(Fx.explosion, this);
|
||||||
|
remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
boolean nearCore = distanceTo(core.worldx(), core.worldy()) <= range - 18f && stopNearCore;
|
boolean nearCore = distanceTo(core.worldx(), core.worldy()) <= range - 18f && stopNearCore;
|
||||||
Vector2 vec;
|
Vector2 vec;
|
||||||
|
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ public class ShieldBlock extends PowerBlock{
|
|||||||
public float powerDrain = 0.005f;
|
public float powerDrain = 0.005f;
|
||||||
public float powerPerDamage = 0.2f;
|
public float powerPerDamage = 0.2f;
|
||||||
public float maxRadius = 40f;
|
public float maxRadius = 40f;
|
||||||
public float radiusScale = 80f;
|
public float radiusScale = 160f;
|
||||||
|
|
||||||
public ShieldBlock(String name) {
|
public ShieldBlock(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
voltage = powerDrain;
|
voltage = powerDrain;
|
||||||
powerCapacity = 30f;
|
powerCapacity = 40f;
|
||||||
health = 100;
|
health = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user