<commit_before>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.xtx.ut4converter.t3d;

import javax.vecmath.Vector3d;

import org.xtx.ut4converter.MapConverter;
import org.xtx.ut4converter.UTGames.UTGame;
import org.xtx.ut4converter.export.UTPackageExtractor;
import org.xtx.ut4converter.ucore.UPackageRessource;

/**
 * Checked: U1, U2, UT99, UT2004, UT3 Tested: UT99
 * 
 * For testing: UT99: DM-Cybrosis][ UT3: VCTF-Necropolis
 * 
 * TODO convert properly JumpVelocity to JumpTarget
 * 
 * @author XtremeXp
 */
public class T3DJumpPad extends T3DSound {

	/**
	 * UT99 for actor class "Kicker" with "KickVelocity" UT2004 for actor class
	 * "xKicker" Unreal 2 for actor class "U2Kicker" UT3 for actor class
	 * "UT_JumpPad"
	 */
	Vector3d jumpVelocity;

	/**
	 * UT99 for actor class "Jumper"
	 */
	Double jumpZ;

	/**
	 * UE4/UT4
	 */
	Vector3d jumpTarget;

	/**
	 * UT3: JumpSound=SoundCue
	 * 'A_Gameplay.JumpPad.Cue.A_Gameplay_JumpPad_Activate_Cue'
	 * 
	 * UT4: JumpSound=SoundCue
	 * '/Game/RestrictedAssets/Audio/Gameplay/A_Gameplay_JumpPadJump01_Cue.A_Gameplay_JumpPadJump01_Cue
	 * '
	 */
	UPackageRessource jumpSound;

	/**
	 * UT3/UT4
	 */
	Double jumpTime = 1.5d;

	public T3DJumpPad(MapConverter mc, String t3dClass) {
		super(mc, t3dClass);

		if (mc.toUT4()) {
			offsetZLocation = -40.5d;
		}
	}

	@Override
	public boolean analyseT3DData(String line) {

		if (line.contains("JumpTime")) {
			jumpTime = T3DUtils.getDouble(line);
		}

		else if (line.contains("JumpZ")) {
			jumpZ = T3DUtils.getDouble(line);
		}

		else if (line.contains("KickVelocity") || line.contains("JumpVelocity")) {
			jumpVelocity = T3DUtils.getVector3d(line, 0d);
		}

		// UT3: JumpSound, U2: KickSound
		else if (line.contains("JumpSound") || line.contains("KickSound")) {
			jumpSound = mapConverter.getUPackageRessource(line.split("\\'")[1], T3DRessource.Type.SOUND);
		}

		return super.analyseT3DData(line);
	}

	@Override
	public void scale(Double newScale) {

		if (jumpVelocity != null) {
			jumpVelocity.scale(newScale);
		}

		if (jumpZ != null) {
			jumpZ *= newScale;
		}

		super.scale(newScale);
	}

	@Override
	public void convert() {<commit_msg>log: inconsitent properties unconverted for jumppad<commit_after>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.xtx.ut4converter.t3d;

import javax.vecmath.Vector3d;

import org.xtx.ut4converter.MapConverter;
import org.xtx.ut4converter.UTGames.UTGame;
import org.xtx.ut4converter.export.UTPackageExtractor;
import org.xtx.ut4converter.ucore.UPackageRessource;

/**
 * Checked: U1, U2, UT99, UT2004, UT3 Tested: UT99
 * 
 * For testing: UT99: DM-Cybrosis][ UT3: VCTF-Necropolis
 * 
 * TODO convert properly JumpVelocity to JumpTarget
 * 
 * @author XtremeXp
 */
public class T3DJumpPad extends T3DSound {

	/**
	 * UT99 for actor class "Kicker" with "KickVelocity" UT2004 for actor class
	 * "xKicker" Unreal 2 for actor class "U2Kicker" UT3 for actor class
	 * "UT_JumpPad"
	 */
	Vector3d jumpVelocity;

	/**
	 * UT99 for actor class "Jumper"
	 */
	Double jumpZ;

	/**
	 * UE4/UT4
	 */
	Vector3d jumpTarget;

	/**
	 * UT3: JumpSound=SoundCue
	 * 'A_Gameplay.JumpPad.Cue.A_Gameplay_JumpPad_Activate_Cue'
	 * 
	 * UT4: JumpSound=SoundCue
	 * '/Game/RestrictedAssets/Audio/Gameplay/A_Gameplay_JumpPadJump01_Cue.A_Gameplay_JumpPadJump01_Cue
	 * '
	 */
	UPackageRessource jumpSound;

	/**
	 * UT3/UT4
	 */
	Double jumpTime = 1.5d;

	public T3DJumpPad(MapConverter mc, String t3dClass) {
		super(mc, t3dClass);

		if (mc.toUT4()) {
			offsetZLocation = -40.5d;
		}
	}

	@Override
	public boolean analyseT3DData(String line) {

		if (line.contains("JumpTime")) {
			jumpTime = T3DUtils.getDouble(line);
		}

		else if (line.contains("JumpZ")) {
			jumpZ = T3DUtils.getDouble(line);
		}

		else if (line.contains("KickVelocity") || line.contains("JumpVelocity")) {
			jumpVelocity = T3DUtils.getVector3d(line, 0d);
		}

		// UT3: JumpSound, U2: KickSound
		else if (line.contains("JumpSound") || line.contains("KickSound")) {
			jumpSound = mapConverter.getUPackageRessource(line.split("\\'")[1], T3DRessource.Type.SOUND);
		}
		else {
			return super.analyseT3DData(line);
		}

		return true;
	}

	@Override
	public void scale(Double newScale) {

		if (jumpVelocity != null) {
			jumpVelocity.scale(newScale);
		}

		if (jumpZ != null) {
			jumpZ *= newScale;
		}

		super.scale(newScale);
	}

	@Override
	public void convert() {
{'fraction_non_alphanumeric': 0.12609531951271638, 'fraction_numerical': 0.028211156229963667, 'mean_word_length': 3.9056603773584904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2491804', 'n_tokens_mistral': 2010, 'n_tokens_neox': 1754, 'n_words': 362}